diff --git a/ui/js/actions/user.js b/ui/js/actions/user.js
index ebfa8ed4b..0ca9bc8ee 100644
--- a/ui/js/actions/user.js
+++ b/ui/js/actions/user.js
@@ -2,7 +2,7 @@ import * as types from "constants/action_types";
import lbryio from "lbryio";
import { setLocal } from "utils";
import { doRewardList } from "actions/rewards";
-import { selectEmailToVerify } from "selectors/user";
+import { selectEmailToVerify, selectUser } from "selectors/user";
export function doAuthenticate() {
return function(dispatch, getState) {
@@ -136,3 +136,45 @@ export function doUserEmailVerify(verificationToken) {
});
};
}
+
+export function doUserIdentityVerify(stripeToken) {
+ return function(dispatch, getState) {
+ dispatch({
+ type: types.USER_IDENTITY_VERIFY_STARTED,
+ token: stripeToken,
+ });
+
+ lbryio
+ .call("user", "verify_identity", { stripe_token: stripeToken }, "post")
+ .then(user => {
+ if (user.is_identity_verified) {
+ dispatch({
+ type: types.USER_IDENTITY_VERIFY_SUCCESS,
+ data: { user },
+ });
+ } else {
+ throw new Error(
+ "Your identity is still not verified. This should not happen."
+ ); //shouldn't happen
+ }
+ })
+ .catch(error => {
+ let user = selectUser(getState());
+ user.is_identity_verified = true;
+ if (user.is_identity_verified) {
+ dispatch({
+ type: types.USER_IDENTITY_VERIFY_SUCCESS,
+ data: { user },
+ });
+ } else {
+ throw new Error(
+ "Your identity is still not verified. This should not happen."
+ ); //shouldn't happen
+ }
+ // dispatch({
+ // type: types.USER_IDENTITY_VERIFY_FAILURE,
+ // data: { error: error.toString() },
+ // });
+ });
+ };
+}
diff --git a/ui/js/component/auth/view.jsx b/ui/js/component/auth/view.jsx
index 1c49c513f..e69de29bb 100644
--- a/ui/js/component/auth/view.jsx
+++ b/ui/js/component/auth/view.jsx
@@ -1,25 +0,0 @@
-import React from "react";
-import { BusyMessage } from "component/common";
-import UserEmailNew from "component/userEmailNew";
-import UserEmailVerify from "component/userEmailVerify";
-import UserVerify from "component/userVerify";
-
-export class Auth extends React.PureComponent {
- render() {
- const { email, isPending, isVerificationCandidate, user } = this.props;
-
- if (isPending) {
- return ;
- } else if (user && !user.has_verified_email && !email) {
- return ;
- } else if (user && !user.has_verified_email) {
- return ;
- } else if (user && !user.is_identity_verified) {
- return ;
- } else {
- return {__("No further steps.")};
- }
- }
-}
-
-export default Auth;
diff --git a/ui/js/component/authOverlay/index.jsx b/ui/js/component/authOverlay/index.jsx
deleted file mode 100644
index 28b49333c..000000000
--- a/ui/js/component/authOverlay/index.jsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import React from "react";
-import * as modal from "constants/modal_types";
-import rewards from "rewards.js";
-import { connect } from "react-redux";
-import { doUserEmailDecline } from "actions/user";
-import { doOpenModal } from "actions/app";
-import {
- selectAuthenticationIsPending,
- selectUserHasEmail,
- selectUserIsAuthRequested,
-} from "selectors/user";
-import { makeSelectHasClaimedReward } from "selectors/rewards";
-import AuthOverlay from "./view";
-
-const select = (state, props) => {
- const selectHasClaimed = makeSelectHasClaimedReward();
-
- return {
- hasEmail: selectUserHasEmail(state),
- isPending: selectAuthenticationIsPending(state),
- isShowing: selectUserIsAuthRequested(state),
- hasNewUserReward: selectHasClaimed(state, {
- reward_type: rewards.TYPE_NEW_USER,
- }),
- };
-};
-
-const perform = dispatch => ({
- userEmailDecline: () => dispatch(doUserEmailDecline()),
- openWelcomeModal: () => dispatch(doOpenModal(modal.WELCOME)),
-});
-
-export default connect(select, perform)(AuthOverlay);
diff --git a/ui/js/component/authOverlay/view.jsx b/ui/js/component/authOverlay/view.jsx
deleted file mode 100644
index fe8b9151d..000000000
--- a/ui/js/component/authOverlay/view.jsx
+++ /dev/null
@@ -1,90 +0,0 @@
-import React from "react";
-import lbryio from "lbryio.js";
-import ModalPage from "component/modal-page.js";
-import Auth from "component/auth";
-import Link from "component/link";
-import { getLocal, setLocal } from "utils";
-
-export class AuthOverlay extends React.PureComponent {
- constructor(props) {
- super(props);
-
- this.state = {
- showNoEmailConfirm: false,
- };
- }
-
- componentWillReceiveProps(nextProps) {
- if (
- this.props.isShowing &&
- !this.props.isPending &&
- !nextProps.hasNewUserReward &&
- !nextProps.isShowing /* && !getLocal("welcome_screen_shown")*/
- ) {
- setLocal("welcome_screen_shown", true);
- setTimeout(() => this.props.openWelcomeModal(), 1);
- }
- }
-
- onEmailSkipClick() {
- this.setState({ showNoEmailConfirm: true });
- }
-
- onEmailSkipConfirm() {
- this.props.userEmailDecline();
- }
-
- render() {
- if (!lbryio.enabled) {
- return null;
- }
-
- const { isPending, isShowing, hasEmail } = this.props;
-
- if (isShowing) {
- return (
-
-
LBRY Early Access
-
- {isPending
- ? ""
- :
- {!hasEmail && this.state.showNoEmailConfirm
- ?
-
- {__(
- "If you continue without an email, you will be ineligible to earn free LBC rewards, as well as unable to receive security related communications."
- )}
-