From 647a5b0c4d8b6689a6a38941471889606f5e4e27 Mon Sep 17 00:00:00 2001
From: Sean Yesmunt
Date: Mon, 6 Apr 2020 17:16:02 -0400
Subject: [PATCH 01/15] new signin/signup
---
.eslintrc.json | 1 +
package.json | 4 +-
static/app-strings.json | 9 +-
ui/component/cardVerify/view.jsx | 2 +-
ui/component/channelCreate/view.jsx | 2 +-
ui/component/common/error-text.jsx | 2 +-
.../common/form-components/form-field.jsx | 4 +-
ui/component/common/icon-custom.jsx | 5 +
ui/component/errorBoundary/view.jsx | 10 +-
ui/component/header/view.jsx | 19 +-
ui/component/invited/view.jsx | 2 +-
ui/component/publishFormErrors/view.jsx | 2 +-
ui/component/router/view.jsx | 6 +-
ui/component/selectAsset/view.jsx | 2 +-
ui/component/sideNavigation/view.jsx | 7 +-
ui/component/splash/view.jsx | 3 +-
ui/component/supportsLiquidate/view.jsx | 2 +-
ui/component/userChannelFollowIntro/view.jsx | 82 +++----
ui/component/userEmail/index.js | 5 +-
ui/component/userEmailNew/index.js | 10 +-
ui/component/userEmailNew/view.jsx | 197 +++++++++-------
ui/component/userEmailReturning/index.js | 13 ++
ui/component/userEmailReturning/view.jsx | 111 +++++++++
ui/component/userEmailVerify/index.js | 5 +-
ui/component/userEmailVerify/view.jsx | 55 +++--
ui/component/userFirstChannel/view.jsx | 83 +++----
ui/component/userSignIn/index.js | 49 +---
ui/component/userSignIn/view.jsx | 213 ++---------------
ui/component/userSignUp/index.js | 52 +++++
ui/component/userSignUp/view.jsx | 215 ++++++++++++++++++
ui/component/userTagFollowIntro/view.jsx | 65 +++---
ui/component/userVerify/view.jsx | 2 +-
ui/component/walletSend/view.jsx | 2 +-
ui/constants/icons.js | 1 +
ui/constants/pages.js | 3 +-
ui/modal/modalRemoveFile/view.jsx | 2 +-
ui/modal/modalRevokeClaim/view.jsx | 2 +-
ui/modal/modalWalletEncrypt/view.jsx | 2 +-
ui/page/rewards/view.jsx | 2 +-
ui/page/signUp/index.js | 7 +
ui/page/signUp/view.jsx | 12 +
ui/scss/component/_card.scss | 5 +
ui/scss/component/_claim-list.scss | 5 +
ui/scss/component/_header.scss | 9 +
ui/scss/component/_main.scss | 23 +-
ui/scss/component/section.scss | 44 ++--
ui/scss/init/_gui.scss | 4 +-
ui/scss/themes/light.scss | 2 +-
yarn.lock | 12 +-
49 files changed, 845 insertions(+), 531 deletions(-)
create mode 100644 ui/component/userEmailReturning/index.js
create mode 100644 ui/component/userEmailReturning/view.jsx
create mode 100644 ui/component/userSignUp/index.js
create mode 100644 ui/component/userSignUp/view.jsx
create mode 100644 ui/page/signUp/index.js
create mode 100644 ui/page/signUp/view.jsx
diff --git a/.eslintrc.json b/.eslintrc.json
index 8c1d7d658..50e4be5cb 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -30,6 +30,7 @@
"one-var": 0,
"prefer-promise-reject-errors": 0,
"react/jsx-indent": 0,
+ "react/jsx-no-comment-textnodes": 0,
"react-hooks/exhaustive-deps": "warn",
"react-hooks/rules-of-hooks": "error",
"react/no-unescaped-entities": 0,
diff --git a/package.json b/package.json
index 28cb90b9b..35e1abc63 100644
--- a/package.json
+++ b/package.json
@@ -68,7 +68,7 @@
"@babel/register": "^7.0.0",
"@exponent/electron-cookies": "^2.0.0",
"@hot-loader/react-dom": "^16.8",
- "@lbry/components": "^4.0.1",
+ "@lbry/components": "^4.1.1",
"@reach/menu-button": "0.7.4",
"@reach/rect": "^0.2.1",
"@reach/tabs": "^0.1.5",
@@ -131,7 +131,7 @@
"json-loader": "^0.5.4",
"lbry-format": "https://github.com/lbryio/lbry-format.git",
"lbry-redux": "lbryio/lbry-redux#1097a63d44a20b87e443fbaa48f95fe3ea5e3f70",
- "lbryinc": "lbryio/lbryinc#0addc624db54000b0447f4539f91f5758d26eef3",
+ "lbryinc": "lbryio/lbryinc#d6203bbea2ceb805465d20198adbdf7759f896a8",
"lint-staged": "^7.0.2",
"localforage": "^1.7.1",
"lodash-es": "^4.17.14",
diff --git a/static/app-strings.json b/static/app-strings.json
index be009501c..580d25ed4 100644
--- a/static/app-strings.json
+++ b/static/app-strings.json
@@ -1116,5 +1116,10 @@
"Repost %count%": "Repost %count%",
"File Description": "File Description",
"View %count% reposts": "View %count% reposts",
- "Preparing your content": "Preparing your content"
-}
+ "Preparing your content": "Preparing your content",
+ "Sign Up with lbry.tv": "Sign Up with lbry.tv",
+ "Already have an account? %sign_in%": "Already have an account? %sign_in%",
+ "Sign in with a password (optional)": "Sign in with a password (optional)",
+ "Sign Up": "Sign Up",
+ "Don't have an account? %sign_up%": "Don't have an account? %sign_up%"
+}
\ No newline at end of file
diff --git a/ui/component/cardVerify/view.jsx b/ui/component/cardVerify/view.jsx
index 901ed4963..904973481 100644
--- a/ui/component/cardVerify/view.jsx
+++ b/ui/component/cardVerify/view.jsx
@@ -165,7 +165,7 @@ class CardVerify extends React.Component {
return (
{scriptFailedToLoad && (
-
There was an error connecting to Stripe. Please try again later.
+
There was an error connecting to Stripe. Please try again later.
)}
{
return (
+
+
+
+
+
+
+ }
+ nag={
+
+ {!emailDoesNotExist && emailExistsFromUrl && (
+
+ )}
+ {emailDoesNotExist && (
+
+ )}
+ {!emailExistsFromUrl && !emailDoesNotExist && errorMessage && (
+
+ )}
+
+ }
+ />
)}
);
diff --git a/ui/component/userEmailVerify/view.jsx b/ui/component/userEmailVerify/view.jsx
index 9ea462ef9..5315fd2b7 100644
--- a/ui/component/userEmailVerify/view.jsx
+++ b/ui/component/userEmailVerify/view.jsx
@@ -61,7 +61,7 @@ class UserEmailVerify extends React.PureComponent {
const { email, isReturningUser, resendingEmail } = this.props;
return (
-
+
{
}
/>
- ,
- chat_link: ,
- }}
- >
- Email %help_link% or join our %chat_link% if you encounter any trouble verifying.
-
+
+ ,
+ chat_link: ,
+ }}
+ >
+ Email %help_link% or join our %chat_link% if you encounter any trouble verifying.
+
+
-
+
);
}
}
diff --git a/ui/component/userPasswordReset/index.js b/ui/component/userPasswordReset/index.js
index 1bdb2ec47..ec8b0b57d 100644
--- a/ui/component/userPasswordReset/index.js
+++ b/ui/component/userPasswordReset/index.js
@@ -2,17 +2,19 @@ import { connect } from 'react-redux';
import {
doUserPasswordReset,
selectPasswordResetSuccess,
- selectPasswordResetPending,
+ selectPasswordResetIsPending,
selectPasswordResetError,
} from 'lbryinc';
+import { doToast } from 'lbry-redux';
import UserSignIn from './view';
const select = state => ({
passwordResetSuccess: selectPasswordResetSuccess(state),
- passwordResetIsPending: selectPasswordResetPending(state),
+ passwordResetIsPending: selectPasswordResetIsPending(state),
passwordResetError: selectPasswordResetError(state),
});
export default connect(select, {
doUserPasswordReset,
+ doToast,
})(UserSignIn);
diff --git a/ui/component/userPasswordReset/view.jsx b/ui/component/userPasswordReset/view.jsx
index 4a9e0022d..49652ae96 100644
--- a/ui/component/userPasswordReset/view.jsx
+++ b/ui/component/userPasswordReset/view.jsx
@@ -8,31 +8,37 @@ import { Form, FormField } from 'component/common/form';
import { EMAIL_REGEX } from 'constants/email';
import ErrorText from 'component/common/error-text';
import Button from 'component/button';
+import Nag from 'component/common/nag';
type Props = {
user: ?User,
- history: { push: string => void },
- location: { search: string },
+ doToast: ({ message: string }) => void,
+ doUserPasswordReset: string => void,
passwordResetPending: boolean,
+ passwordResetSuccess: boolean,
+ passwordResetError: ?string,
};
function UserPasswordReset(props: Props) {
- const {
- doUserPasswordReset,
- location,
- history,
- passwordResetPending,
- passwordResetError,
- passwordResetSuccess,
- } = props;
+ const { doUserPasswordReset, passwordResetPending, passwordResetError, passwordResetSuccess, doToast } = props;
const { search } = location;
- const [email, setEmail] = React.useState('');
+ const urlParams = new URLSearchParams(search);
+ const defaultEmail = urlParams.get('email');
+ const [email, setEmail] = React.useState(defaultEmail);
const valid = email.match(EMAIL_REGEX);
function handleSubmit() {
doUserPasswordReset(email);
}
+ React.useEffect(() => {
+ if (passwordResetSuccess) {
+ doToast({
+ message: __('Email sent!'),
+ });
+ }
+ }, [passwordResetSuccess]);
+
return (
setEmail(e.target.value)}
/>
@@ -58,7 +64,6 @@ function UserPasswordReset(props: Props) {
disabled={!email || !valid || passwordResetPending}
/>
{passwordResetPending && }
- {passwordResetSuccess && Email sent! }
{passwordResetError && (
@@ -68,9 +73,14 @@ function UserPasswordReset(props: Props) {
)}
}
+ nag={
+ passwordResetSuccess && (
+
+ )
+ }
/>
- or{' '}
+
diff --git a/ui/component/userPasswordSet/index.js b/ui/component/userPasswordSet/index.js
index 2d482bbb7..e1c396903 100644
--- a/ui/component/userPasswordSet/index.js
+++ b/ui/component/userPasswordSet/index.js
@@ -1,10 +1,15 @@
import { connect } from 'react-redux';
-import { doUserPasswordSet, selectPasswordSetSuccess, selectPasswordSetPending, selectPasswordSetError } from 'lbryinc';
+import {
+ doUserPasswordSet,
+ selectPasswordSetSuccess,
+ selectPasswordSetIsPending,
+ selectPasswordSetError,
+} from 'lbryinc';
import UserSignIn from './view';
const select = state => ({
passwordSetSuccess: selectPasswordSetSuccess(state),
- passwordSetIsPending: selectPasswordSetPending(state),
+ passwordSetIsPending: selectPasswordSetIsPending(state),
passwordSetError: selectPasswordSetError(state),
});
diff --git a/ui/component/userPasswordSet/view.jsx b/ui/component/userPasswordSet/view.jsx
index 3e5370ee2..416511b68 100644
--- a/ui/component/userPasswordSet/view.jsx
+++ b/ui/component/userPasswordSet/view.jsx
@@ -13,7 +13,7 @@ type Props = {
history: { push: string => void },
location: { search: string },
passwordSetPending: boolean,
- passwordSetError: boolean,
+ passwordSetError: ?string,
};
function UserPasswordReset(props: Props) {
@@ -30,7 +30,7 @@ function UserPasswordReset(props: Props) {
'set',
{
auth_token: authToken,
- password,
+ new_password: password,
},
'post'
)
@@ -56,7 +56,7 @@ function UserPasswordReset(props: Props) {
name="password_set"
label={__('New Password')}
value={password}
- onChange={e => setPassword(e.target.value)}
+ onChange={e => console.log('e', e.target.value) || setPassword(e.target.value)}
/>
@@ -77,7 +77,7 @@ function UserPasswordReset(props: Props) {
}
/>
- or{' '}
+
diff --git a/ui/component/userSignIn/index.js b/ui/component/userSignIn/index.js
index 4489862a7..e0a559098 100644
--- a/ui/component/userSignIn/index.js
+++ b/ui/component/userSignIn/index.js
@@ -1,10 +1,14 @@
import { connect } from 'react-redux';
-import { selectUser, selectUserIsPending } from 'lbryinc';
+import { selectUser, selectUserIsPending, selectEmailToVerify, selectPasswordExists, doUserSignIn } from 'lbryinc';
import UserSignIn from './view';
const select = state => ({
user: selectUser(state),
userFetchPending: selectUserIsPending(state),
+ emailToVerify: selectEmailToVerify(state),
+ passwordExists: selectPasswordExists(state),
});
-export default connect(select)(UserSignIn);
+export default connect(select, {
+ doUserSignIn,
+})(UserSignIn);
diff --git a/ui/component/userSignIn/view.jsx b/ui/component/userSignIn/view.jsx
index 2e6a969a0..b8d1485e0 100644
--- a/ui/component/userSignIn/view.jsx
+++ b/ui/component/userSignIn/view.jsx
@@ -2,6 +2,7 @@
import React from 'react';
import { withRouter } from 'react-router';
import UserEmailReturning from 'component/userEmailReturning';
+import UserSignInPassword from 'component/userSignInPassword';
import Spinner from 'component/spinner';
type Props = {
@@ -9,28 +10,45 @@ type Props = {
history: { push: string => void },
location: { search: string },
userFetchPending: boolean,
+ doUserSignIn: string => void,
+ emailToVerify: ?string,
+ passwordExists: boolean,
};
function UserSignIn(props: Props) {
- const { user, location, history, userFetchPending } = props;
+ const { user, location, history, doUserSignIn, userFetchPending, emailToVerify, passwordExists } = props;
const { search } = location;
const urlParams = new URLSearchParams(search);
+ const [emailOnlyLogin, setEmailOnlyLogin] = React.useState(false);
+ const hasVerifiedEmail = user && user.has_verified_email;
const redirect = urlParams.get('redirect');
- const showUserEmail = user && !user.password_set && !user.has_verified_email;
const showLoading = userFetchPending;
+ const showEmail = !passwordExists || emailOnlyLogin;
+ const showPassword = !showEmail && emailToVerify && passwordExists;
React.useEffect(() => {
- if (!showUserEmail) {
+ if (hasVerifiedEmail || (!showEmail && !showPassword && !showLoading)) {
history.push(redirect || '/');
}
- }, [showUserEmail]);
+ }, [showEmail, showPassword, showLoading, hasVerifiedEmail]);
+
+ React.useEffect(() => {
+ if (emailToVerify && emailOnlyLogin) {
+ doUserSignIn(emailToVerify);
+ }
+ }, [emailToVerify, emailOnlyLogin, doUserSignIn]);
return (
-
- {!showLoading && {showUserEmail && }
}
+
+ {!showLoading && (
+
+ {showEmail && }
+ {showPassword && setEmailOnlyLogin(true)} />}
+
+ )}
{showLoading && (
-
+
)}
diff --git a/ui/component/userSignInPassword/index.js b/ui/component/userSignInPassword/index.js
new file mode 100644
index 000000000..e394d1e96
--- /dev/null
+++ b/ui/component/userSignInPassword/index.js
@@ -0,0 +1,22 @@
+import { connect } from 'react-redux';
+import {
+ selectUser,
+ selectUserIsPending,
+ selectEmailToVerify,
+ selectEmailNewErrorMessage,
+ doUserSignIn,
+ doClearEmailEntry,
+} from 'lbryinc';
+import UserSignIn from './view';
+
+const select = state => ({
+ user: selectUser(state),
+ userFetchPending: selectUserIsPending(state),
+ emailToVerify: selectEmailToVerify(state),
+ errorMessage: selectEmailNewErrorMessage(state),
+});
+
+export default connect(select, {
+ doUserSignIn,
+ doClearEmailEntry,
+})(UserSignIn);
diff --git a/ui/component/userSignInPassword/view.jsx b/ui/component/userSignInPassword/view.jsx
new file mode 100644
index 000000000..925526de5
--- /dev/null
+++ b/ui/component/userSignInPassword/view.jsx
@@ -0,0 +1,69 @@
+// @flow
+import * as PAGES from 'constants/pages';
+import React, { useState } from 'react';
+import { FormField, Form } from 'component/common/form';
+import Button from 'component/button';
+import Card from 'component/common/card';
+import analytics from 'analytics';
+import Nag from 'component/common/nag';
+
+type Props = {
+ errorMessage: ?string,
+ emailToVerify: ?string,
+ doClearEmailEntry: () => void,
+ doUserSignIn: (string, ?string) => void,
+ onHandleEmailOnly: () => void,
+};
+
+export default function UserSignInPassword(props: Props) {
+ const { errorMessage, doUserSignIn, emailToVerify, doClearEmailEntry, onHandleEmailOnly } = props;
+ const [password, setPassword] = useState('');
+
+ function handleSubmit() {
+ if (emailToVerify) {
+ doUserSignIn(emailToVerify, password);
+ analytics.emailProvidedEvent();
+ }
+ }
+
+ function handleChangeToSignIn() {
+ onHandleEmailOnly();
+ }
+
+ return (
+
+
+
+ setPassword(e.target.value)}
+ />
+
+
+
+
+
+
+
+ }
+ nag={errorMessage && }
+ />
+
+
+
+
+
+ );
+}
diff --git a/ui/modal/walletReceive/view.jsx b/ui/modal/walletReceive/view.jsx
deleted file mode 100644
index 85746bff8..000000000
--- a/ui/modal/walletReceive/view.jsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import React from 'react';
-import WalletAddress from 'component/walletAddress';
-import Page from 'component/page';
-
-const WalletAddressPage = () => (
-
-
-
-);
-
-export default WalletAddressPage;
diff --git a/ui/modal/walletSend/view.jsx b/ui/modal/walletSend/view.jsx
deleted file mode 100644
index 57bc0dacc..000000000
--- a/ui/modal/walletSend/view.jsx
+++ /dev/null
@@ -1,10 +0,0 @@
-import React from 'react';
-import WalletSend from 'component/walletSend';
-
-const WalletSendModal = () => (
-
-
-
-);
-
-export default WalletSendModal;
diff --git a/ui/page/settings/view.jsx b/ui/page/settings/view.jsx
index 31d9143c7..8d06b4d39 100644
--- a/ui/page/settings/view.jsx
+++ b/ui/page/settings/view.jsx
@@ -18,6 +18,7 @@ import { SETTINGS } from 'lbry-redux';
import Card from 'component/common/card';
import { getPasswordFromCookie } from 'util/saved-passwords';
import Spinner from 'component/spinner';
+import SettingAccountPassword from 'component/settingAccountPassword';
// @if TARGET='app'
export const IS_MAC = process.platform === 'darwin';
@@ -261,11 +262,12 @@ class SettingsPage extends React.PureComponent {
{!IS_WEB && noDaemonSettings ? (
- {__('Failed to load settings.')}
+ {__('Failed to load settings.')}
) : (
} />
+ {isAuthenticated &&
}
{/* @if TARGET='app' */}
void, location: { search: string } },
@@ -88,40 +89,49 @@ function SignInVerifyPage(props: Props) {
return (
-
-
- {isAuthenticationSuccess ? __('Sign In Success!') : __('Sign In to lbry.tv')}
-
-
- {isAuthenticationSuccess
- ? __('You can now close this tab.')
- : needsRecaptcha
- ? __('Click below to sign in to lbry.tv')
- : __('Welcome back! You are automatically being signed in.')}
-
-
- {showCaptchaMessage && !isAuthenticationSuccess && (
- window.location.reload()} />,
- }}
- >
- Not seeing a captcha? Check your ad blocker or try %refresh%.
-
- )}
-
- {!isAuthenticationSuccess && needsRecaptcha && (
-
-
-
- )}
-
+
+
+
+ {isAuthenticationSuccess
+ ? __('You can now close this tab.')
+ : needsRecaptcha
+ ? __('Click below to sign in to lbry.tv')
+ : __('Welcome back! You are automatically being signed in.')}
+
+ {showCaptchaMessage && !isAuthenticationSuccess && (
+
+ window.location.reload()} />
+ ),
+ }}
+ >
+ Not seeing a captcha? Check your ad blocker or try %refresh%.
+
+
+ )}
+
+ }
+ actions={
+ !isAuthenticationSuccess &&
+ needsRecaptcha && (
+
+
+
+ )
+ }
+ />
+
);
}
diff --git a/ui/scss/component/_card.scss b/ui/scss/component/_card.scss
index 6933816df..bdb708589 100644
--- a/ui/scss/component/_card.scss
+++ b/ui/scss/component/_card.scss
@@ -242,5 +242,16 @@
.card__bottom-gutter {
@extend .help;
+ display: flex;
+ align-items: center;
margin-top: var(--spacing-medium);
+
+ &:only-child,
+ &:first-child {
+ margin-top: 0;
+ }
+
+ > *:not(:last-child) {
+ margin-right: var(--spacing-medium);
+ }
}
diff --git a/ui/scss/component/_main.scss b/ui/scss/component/_main.scss
index 524e84d00..5858fc1ab 100644
--- a/ui/scss/component/_main.scss
+++ b/ui/scss/component/_main.scss
@@ -76,18 +76,13 @@
width: 100%;
}
-.main__sign-in {
+.main__sign-in,
+.main__sign-up {
max-width: 27rem;
margin-left: auto;
margin-right: auto;
}
-.main__sign-up {
- margin-left: auto;
- margin-right: auto;
- max-width: 35rem;
-}
-
.main__channel-creation {
margin-left: auto;
margin-right: auto;
diff --git a/ui/scss/component/nag.scss b/ui/scss/component/nag.scss
index e14e2e7ab..e0a3a2cc9 100644
--- a/ui/scss/component/nag.scss
+++ b/ui/scss/component/nag.scss
@@ -32,6 +32,10 @@ $nag-error-z-index: 100001;
z-index: 1 !important; /* booooooo */
}
+.nag--relative {
+ position: relative;
+}
+
.nag--helpful {
background-color: var(--color-secondary);
color: var(--color-white);
diff --git a/ui/scss/component/section.scss b/ui/scss/component/section.scss
index ce781bf61..ad5e6e6b3 100644
--- a/ui/scss/component/section.scss
+++ b/ui/scss/component/section.scss
@@ -109,9 +109,17 @@
}
}
+ .button--primary,
+ .button ~ .button--link {
+ &:focus {
+ @include focus;
+ }
+ }
+
.button--primary ~ .button--link {
font-weight: var(--font-weight-bold);
margin-left: var(--spacing-small);
+ padding: var(--spacing-xsmall);
}
}
diff --git a/yarn.lock b/yarn.lock
index a8e34c063..b162398ab 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -6147,9 +6147,9 @@ lbry-redux@lbryio/lbry-redux#1097a63d44a20b87e443fbaa48f95fe3ea5e3f70:
reselect "^3.0.0"
uuid "^3.3.2"
-lbryinc@lbryio/lbryinc#d7168f9faef85002f7f0c267f65dddd83b9a2952:
+lbryinc@lbryio/lbryinc#05a1c5fc1a558132ef85ac5cca55357842d0ffd7:
version "0.0.1"
- resolved "https://codeload.github.com/lbryio/lbryinc/tar.gz/d7168f9faef85002f7f0c267f65dddd83b9a2952"
+ resolved "https://codeload.github.com/lbryio/lbryinc/tar.gz/05a1c5fc1a558132ef85ac5cca55357842d0ffd7"
dependencies:
reselect "^3.0.0"
--
2.45.3
From af8d02f9811effc7d4f991dcd1071e4f31e291fa Mon Sep 17 00:00:00 2001
From: Sean Yesmunt
Date: Fri, 10 Apr 2020 13:43:25 -0400
Subject: [PATCH 04/15] cleanup
---
ui/component/header/view.jsx | 4 ++--
ui/component/userEmailNew/view.jsx | 4 ++--
ui/component/userEmailReturning/view.jsx | 2 +-
ui/util/saved-passwords.js | 3 ++-
4 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/ui/component/header/view.jsx b/ui/component/header/view.jsx
index 3a3eb2dfc..d19cae5f2 100644
--- a/ui/component/header/view.jsx
+++ b/ui/component/header/view.jsx
@@ -192,7 +192,7 @@ const Header = (props: Props) => {
history.push(`/$/${PAGES.AUTH}`)}>
- {__('Sign Up')}
+ {__('Join')}
history.push(`/$/${PAGES.AUTH_SIGNIN}`)}>
@@ -228,7 +228,7 @@ const Header = (props: Props) => {
{IS_WEB && !authenticated && (
-
+
)}
diff --git a/ui/component/userEmailNew/view.jsx b/ui/component/userEmailNew/view.jsx
index 626dbb0e5..4c28ddef4 100644
--- a/ui/component/userEmailNew/view.jsx
+++ b/ui/component/userEmailNew/view.jsx
@@ -86,7 +86,7 @@ function UserEmailNew(props: Props) {
return (
-
+
diff --git a/ui/util/saved-passwords.js b/ui/util/saved-passwords.js
index 0b3b70861..6dbde307e 100644
--- a/ui/util/saved-passwords.js
+++ b/ui/util/saved-passwords.js
@@ -2,7 +2,8 @@ const { DOMAIN } = require('../../config.js');
const AUTH_TOKEN = 'auth_token';
const SAVED_PASSWORD = 'saved_password';
const DEPRECATED_SAVED_PASSWORD = 'saved-password';
-const domain = typeof window === 'object' ? window.location.hostname : DOMAIN;
+const domain =
+ typeof window === 'object' && window.location.hostname.includes('localhost') ? window.location.hostname : DOMAIN;
const isProduction = process.env.NODE_ENV === 'production';
const maxExpiration = 2147483647;
let sessionPassword;
--
2.45.3
From ead174361335995e38e4bfbf1c4f2ab2d2f293ca Mon Sep 17 00:00:00 2001
From: Sean Yesmunt
Date: Fri, 10 Apr 2020 14:04:05 -0400
Subject: [PATCH 05/15] add 'autoComplete' props
---
ui/component/userEmailNew/view.jsx | 1 +
ui/component/userEmailReturning/view.jsx | 1 +
ui/component/userSignInPassword/view.jsx | 3 ++-
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/ui/component/userEmailNew/view.jsx b/ui/component/userEmailNew/view.jsx
index 4c28ddef4..b114fa6b1 100644
--- a/ui/component/userEmailNew/view.jsx
+++ b/ui/component/userEmailNew/view.jsx
@@ -95,6 +95,7 @@ function UserEmailNew(props: Props) {
--
2.45.3
From a2d759205530a010ab3a7aa6d2e2c50f3e1db215 Mon Sep 17 00:00:00 2001
From: Sean Yesmunt
Date: Fri, 10 Apr 2020 14:16:29 -0400
Subject: [PATCH 06/15] fix prop
---
ui/component/userEmailReturning/view.jsx | 2 +-
ui/component/userSignInPassword/view.jsx | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ui/component/userEmailReturning/view.jsx b/ui/component/userEmailReturning/view.jsx
index 2045b4245..3d8eb1ca0 100644
--- a/ui/component/userEmailReturning/view.jsx
+++ b/ui/component/userEmailReturning/view.jsx
@@ -60,7 +60,7 @@ function UserEmailReturning(props: Props) {
Date: Fri, 10 Apr 2020 17:31:09 -0400
Subject: [PATCH 07/15] try to call email/confirm before resetting password
---
ui/component/userPasswordSet/view.jsx | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/ui/component/userPasswordSet/view.jsx b/ui/component/userPasswordSet/view.jsx
index 416511b68..92484c3c0 100644
--- a/ui/component/userPasswordSet/view.jsx
+++ b/ui/component/userPasswordSet/view.jsx
@@ -22,18 +22,27 @@ function UserPasswordReset(props: Props) {
const urlParams = new URLSearchParams(location.search);
const email = urlParams.get('email');
const authToken = urlParams.get('auth_token');
+ const verificationToken = urlParams.get('verification_token');
const [password, setPassword] = React.useState('');
function handleSubmit() {
- Lbryio.call(
- 'user_password',
- 'set',
- {
- auth_token: authToken,
- new_password: password,
- },
- 'post'
- )
+ Lbryio.call('user_email', 'confirm', {
+ auth_token: authToken,
+ email: email,
+ verification_token: verificationToken,
+ })
+ .then(() => {
+ return Lbryio.call(
+ 'user_password',
+ 'set',
+ {
+ auth_token: authToken,
+ new_password: password,
+ },
+ 'post'
+ );
+ })
+
.then(res => {
debugger;
})
--
2.45.3
From 2c1ea68f9354a94dca18769231cd60b62ed8ac86 Mon Sep 17 00:00:00 2001
From: Mark Beamer Jr
Date: Sun, 12 Apr 2020 23:16:47 -0400
Subject: [PATCH 08/15] Dont use password reset token for email confirmation.
---
ui/component/userPasswordSet/view.jsx | 1 -
1 file changed, 1 deletion(-)
diff --git a/ui/component/userPasswordSet/view.jsx b/ui/component/userPasswordSet/view.jsx
index 92484c3c0..6e6231048 100644
--- a/ui/component/userPasswordSet/view.jsx
+++ b/ui/component/userPasswordSet/view.jsx
@@ -27,7 +27,6 @@ function UserPasswordReset(props: Props) {
function handleSubmit() {
Lbryio.call('user_email', 'confirm', {
- auth_token: authToken,
email: email,
verification_token: verificationToken,
})
--
2.45.3
From 8c8d59030139f369fd540cb2603e9702656c31f5 Mon Sep 17 00:00:00 2001
From: Sean Yesmunt
Date: Mon, 13 Apr 2020 09:53:59 -0400
Subject: [PATCH 09/15] add password reset
---
package.json | 2 +-
ui/component/userPasswordReset/index.js | 2 +
ui/component/userPasswordReset/view.jsx | 33 +++++++++++----
ui/component/userPasswordSet/index.js | 18 ++++-----
ui/component/userPasswordSet/view.jsx | 53 ++++++++++++++++---------
yarn.lock | 4 +-
6 files changed, 74 insertions(+), 38 deletions(-)
diff --git a/package.json b/package.json
index 39a2b0bda..abbcced31 100644
--- a/package.json
+++ b/package.json
@@ -131,7 +131,7 @@
"json-loader": "^0.5.4",
"lbry-format": "https://github.com/lbryio/lbry-format.git",
"lbry-redux": "lbryio/lbry-redux#1097a63d44a20b87e443fbaa48f95fe3ea5e3f70",
- "lbryinc": "lbryio/lbryinc#05a1c5fc1a558132ef85ac5cca55357842d0ffd7",
+ "lbryinc": "lbryio/lbryinc#b411291da72727897afb153114894932c9561281",
"lint-staged": "^7.0.2",
"localforage": "^1.7.1",
"lodash-es": "^4.17.14",
diff --git a/ui/component/userPasswordReset/index.js b/ui/component/userPasswordReset/index.js
index ec8b0b57d..ecd39d97f 100644
--- a/ui/component/userPasswordReset/index.js
+++ b/ui/component/userPasswordReset/index.js
@@ -4,6 +4,7 @@ import {
selectPasswordResetSuccess,
selectPasswordResetIsPending,
selectPasswordResetError,
+ doClearPasswordEntries,
} from 'lbryinc';
import { doToast } from 'lbry-redux';
import UserSignIn from './view';
@@ -17,4 +18,5 @@ const select = state => ({
export default connect(select, {
doUserPasswordReset,
doToast,
+ doClearPasswordEntries,
})(UserSignIn);
diff --git a/ui/component/userPasswordReset/view.jsx b/ui/component/userPasswordReset/view.jsx
index 49652ae96..704fad6c5 100644
--- a/ui/component/userPasswordReset/view.jsx
+++ b/ui/component/userPasswordReset/view.jsx
@@ -1,7 +1,7 @@
// @flow
import * as PAGES from 'constants/pages';
import React from 'react';
-import { withRouter } from 'react-router';
+import { useHistory } from 'react-router-dom';
import Card from 'component/common/card';
import Spinner from 'component/spinner';
import { Form, FormField } from 'component/common/form';
@@ -14,21 +14,38 @@ type Props = {
user: ?User,
doToast: ({ message: string }) => void,
doUserPasswordReset: string => void,
+ doClearPasswordEntries: () => void,
passwordResetPending: boolean,
passwordResetSuccess: boolean,
passwordResetError: ?string,
};
function UserPasswordReset(props: Props) {
- const { doUserPasswordReset, passwordResetPending, passwordResetError, passwordResetSuccess, doToast } = props;
+ const {
+ doUserPasswordReset,
+ passwordResetPending,
+ passwordResetError,
+ passwordResetSuccess,
+ doToast,
+ doClearPasswordEntries,
+ } = props;
+ const { location, replace } = useHistory();
const { search } = location;
const urlParams = new URLSearchParams(search);
const defaultEmail = urlParams.get('email');
- const [email, setEmail] = React.useState(defaultEmail);
+ const [email, setEmail] = React.useState(defaultEmail || '');
const valid = email.match(EMAIL_REGEX);
function handleSubmit() {
- doUserPasswordReset(email);
+ if (email) {
+ doUserPasswordReset(email);
+ }
+ }
+
+ function handleRestart() {
+ setEmail('');
+ doClearPasswordEntries();
+ replace();
}
React.useEffect(() => {
@@ -37,7 +54,7 @@ function UserPasswordReset(props: Props) {
message: __('Email sent!'),
});
}
- }, [passwordResetSuccess]);
+ }, [passwordResetSuccess, doToast]);
return (
@@ -48,6 +65,7 @@ function UserPasswordReset(props: Props) {
+ {passwordResetSuccess && }
{passwordResetPending && }
@@ -87,4 +106,4 @@ function UserPasswordReset(props: Props) {
);
}
-export default withRouter(UserPasswordReset);
+export default UserPasswordReset;
diff --git a/ui/component/userPasswordSet/index.js b/ui/component/userPasswordSet/index.js
index e1c396903..ead9767aa 100644
--- a/ui/component/userPasswordSet/index.js
+++ b/ui/component/userPasswordSet/index.js
@@ -1,18 +1,16 @@
import { connect } from 'react-redux';
-import {
- doUserPasswordSet,
- selectPasswordSetSuccess,
- selectPasswordSetIsPending,
- selectPasswordSetError,
-} from 'lbryinc';
+import { doClearEmailEntry, doUserFetch } from 'lbryinc';
+import { doToast } from 'lbry-redux';
import UserSignIn from './view';
const select = state => ({
- passwordSetSuccess: selectPasswordSetSuccess(state),
- passwordSetIsPending: selectPasswordSetIsPending(state),
- passwordSetError: selectPasswordSetError(state),
+ // passwordSetSuccess: selectPasswordSetSuccess(state),
+ // passwordSetIsPending: selectPasswordSetIsPending(state),
+ // passwordSetError: selectPasswordSetError(state),
});
export default connect(select, {
- doUserPasswordSet,
+ doToast,
+ doClearEmailEntry,
+ doUserFetch,
})(UserSignIn);
diff --git a/ui/component/userPasswordSet/view.jsx b/ui/component/userPasswordSet/view.jsx
index 6e6231048..fc49d5ab1 100644
--- a/ui/component/userPasswordSet/view.jsx
+++ b/ui/component/userPasswordSet/view.jsx
@@ -7,9 +7,14 @@ import Card from 'component/common/card';
import { Form, FormField } from 'component/common/form';
import ErrorText from 'component/common/error-text';
import Button from 'component/button';
+import Nag from 'component/common/nag';
+import Spinner from 'component/spinner';
type Props = {
user: ?User,
+ doClearEmailEntry: () => void,
+ doUserFetch: () => void,
+ doToast: ({ message: string }) => void,
history: { push: string => void },
location: { search: string },
passwordSetPending: boolean,
@@ -17,21 +22,25 @@ type Props = {
};
function UserPasswordReset(props: Props) {
- const { passwordSetPending, passwordSetError } = props;
- const { location } = useHistory();
+ const { doClearEmailEntry, doToast, doUserFetch } = props;
+ const { location, push } = useHistory();
const urlParams = new URLSearchParams(location.search);
const email = urlParams.get('email');
const authToken = urlParams.get('auth_token');
const verificationToken = urlParams.get('verification_token');
const [password, setPassword] = React.useState('');
+ const [error, setError] = React.useState();
+ const [loading, setLoading] = React.useState(false);
function handleSubmit() {
+ setLoading(true);
+
Lbryio.call('user_email', 'confirm', {
email: email,
verification_token: verificationToken,
})
- .then(() => {
- return Lbryio.call(
+ .then(() =>
+ Lbryio.call(
'user_password',
'set',
{
@@ -39,17 +48,27 @@ function UserPasswordReset(props: Props) {
new_password: password,
},
'post'
- );
- })
-
- .then(res => {
- debugger;
+ )
+ )
+ .then(doUserFetch)
+ .then(() => {
+ setLoading(false);
+ doToast({
+ message: __('Password successfully changed!'),
+ });
+ push(`/`);
})
.catch(error => {
- debugger;
+ setLoading(false);
+ setError(error.message);
});
}
+ function handleRestart() {
+ doClearEmailEntry();
+ push(`/$/${PAGES.AUTH_SIGNIN}`);
+ }
+
return (
console.log('e', e.target.value) || setPassword(e.target.value)}
+ onChange={e => setPassword(e.target.value)}
/>
+ {error && }
+ {loading && }
- {passwordSetError && (
-
- {passwordSetError}
-
- )}
}
+ nag={error && {error}} />}
/>
diff --git a/yarn.lock b/yarn.lock
index b162398ab..2a3761415 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -6147,9 +6147,9 @@ lbry-redux@lbryio/lbry-redux#1097a63d44a20b87e443fbaa48f95fe3ea5e3f70:
reselect "^3.0.0"
uuid "^3.3.2"
-lbryinc@lbryio/lbryinc#05a1c5fc1a558132ef85ac5cca55357842d0ffd7:
+lbryinc@lbryio/lbryinc#b411291da72727897afb153114894932c9561281:
version "0.0.1"
- resolved "https://codeload.github.com/lbryio/lbryinc/tar.gz/05a1c5fc1a558132ef85ac5cca55357842d0ffd7"
+ resolved "https://codeload.github.com/lbryio/lbryinc/tar.gz/b411291da72727897afb153114894932c9561281"
dependencies:
reselect "^3.0.0"
--
2.45.3
From 746b9c6de91b077f10e7a0c0ef6340891184d657 Mon Sep 17 00:00:00 2001
From: Sean Yesmunt
Date: Mon, 13 Apr 2020 10:57:56 -0400
Subject: [PATCH 10/15] password manager improvements
---
ui/component/userEmailReturning/view.jsx | 3 ++-
ui/component/userPasswordReset/view.jsx | 2 ++
ui/component/userSignInPassword/view.jsx | 3 ++-
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/ui/component/userEmailReturning/view.jsx b/ui/component/userEmailReturning/view.jsx
index 3d8eb1ca0..eef1a9674 100644
--- a/ui/component/userEmailReturning/view.jsx
+++ b/ui/component/userEmailReturning/view.jsx
@@ -60,10 +60,11 @@ function UserEmailReturning(props: Props) {
setEmail(e.target.value)}
diff --git a/ui/component/userSignInPassword/view.jsx b/ui/component/userSignInPassword/view.jsx
index 91fd1a3bc..1d9777a35 100644
--- a/ui/component/userSignInPassword/view.jsx
+++ b/ui/component/userSignInPassword/view.jsx
@@ -40,9 +40,10 @@ export default function UserSignInPassword(props: Props) {
setPassword(e.target.value)}
--
2.45.3
From 563830f7ea954ed3c7762c37a0410c843e6fe7a8 Mon Sep 17 00:00:00 2001
From: Sean Yesmunt
Date: Mon, 13 Apr 2020 11:08:06 -0400
Subject: [PATCH 11/15] update lbryinc
---
package.json | 2 +-
yarn.lock | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/package.json b/package.json
index abbcced31..557ea06d2 100644
--- a/package.json
+++ b/package.json
@@ -131,7 +131,7 @@
"json-loader": "^0.5.4",
"lbry-format": "https://github.com/lbryio/lbry-format.git",
"lbry-redux": "lbryio/lbry-redux#1097a63d44a20b87e443fbaa48f95fe3ea5e3f70",
- "lbryinc": "lbryio/lbryinc#b411291da72727897afb153114894932c9561281",
+ "lbryinc": "lbryio/lbryinc#75f992ef02ddef3e1cfe3a6632710fffd04b0c68",
"lint-staged": "^7.0.2",
"localforage": "^1.7.1",
"lodash-es": "^4.17.14",
diff --git a/yarn.lock b/yarn.lock
index 2a3761415..d70251459 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -6147,9 +6147,9 @@ lbry-redux@lbryio/lbry-redux#1097a63d44a20b87e443fbaa48f95fe3ea5e3f70:
reselect "^3.0.0"
uuid "^3.3.2"
-lbryinc@lbryio/lbryinc#b411291da72727897afb153114894932c9561281:
+lbryinc@lbryio/lbryinc#75f992ef02ddef3e1cfe3a6632710fffd04b0c68:
version "0.0.1"
- resolved "https://codeload.github.com/lbryio/lbryinc/tar.gz/b411291da72727897afb153114894932c9561281"
+ resolved "https://codeload.github.com/lbryio/lbryinc/tar.gz/75f992ef02ddef3e1cfe3a6632710fffd04b0c68"
dependencies:
reselect "^3.0.0"
--
2.45.3
From 816b3344465ad2c4a7da89a2cafaa275082c4d50 Mon Sep 17 00:00:00 2001
From: Sean Yesmunt
Date: Mon, 13 Apr 2020 13:52:44 -0400
Subject: [PATCH 12/15] cleanup
---
package.json | 4 +-
ui/component/header/index.js | 10 ++++-
ui/component/header/view.jsx | 22 +++++++++-
ui/component/router/view.jsx | 2 -
ui/component/settingAccountPassword/index.js | 4 +-
ui/component/settingAccountPassword/view.jsx | 8 ++--
ui/component/userEmailNew/view.jsx | 30 ++++++--------
ui/component/userEmailVerify/view.jsx | 42 ++++++++++----------
ui/component/userPasswordReset/index.js | 6 ++-
ui/component/userPasswordReset/view.jsx | 33 +++++++--------
ui/component/userPasswordSet/view.jsx | 6 +--
ui/component/userSignIn/view.jsx | 4 +-
ui/component/userSignInPassword/view.jsx | 32 +++++++--------
ui/component/userSignOutButton/index.js | 14 +++----
ui/component/userSignOutButton/view.jsx | 18 +++++++--
ui/constants/pages.js | 3 +-
ui/page/passwordReset/index.js | 3 --
ui/page/passwordReset/view.jsx | 12 ------
ui/scss/component/_button.scss | 5 +++
ui/scss/component/_modal.scss | 6 ++-
ui/scss/init/_gui.scss | 2 +-
yarn.lock | 12 +++---
22 files changed, 145 insertions(+), 133 deletions(-)
delete mode 100644 ui/page/passwordReset/index.js
delete mode 100644 ui/page/passwordReset/view.jsx
diff --git a/package.json b/package.json
index 557ea06d2..97ca2d7ee 100644
--- a/package.json
+++ b/package.json
@@ -68,7 +68,7 @@
"@babel/register": "^7.0.0",
"@exponent/electron-cookies": "^2.0.0",
"@hot-loader/react-dom": "^16.8",
- "@lbry/components": "^4.1.1",
+ "@lbry/components": "^4.1.2",
"@reach/menu-button": "0.7.4",
"@reach/rect": "^0.2.1",
"@reach/tabs": "^0.1.5",
@@ -131,7 +131,7 @@
"json-loader": "^0.5.4",
"lbry-format": "https://github.com/lbryio/lbry-format.git",
"lbry-redux": "lbryio/lbry-redux#1097a63d44a20b87e443fbaa48f95fe3ea5e3f70",
- "lbryinc": "lbryio/lbryinc#75f992ef02ddef3e1cfe3a6632710fffd04b0c68",
+ "lbryinc": "lbryio/lbryinc#12aefaa14343d2f3eac01f2683701f58e53f1848",
"lint-staged": "^7.0.2",
"localforage": "^1.7.1",
"lodash-es": "^4.17.14",
diff --git a/ui/component/header/index.js b/ui/component/header/index.js
index 5877c6825..6c0ea9f26 100644
--- a/ui/component/header/index.js
+++ b/ui/component/header/index.js
@@ -2,7 +2,13 @@ import * as SETTINGS from 'constants/settings';
import * as MODALS from 'constants/modal_types';
import { connect } from 'react-redux';
import { selectBalance, formatCredits } from 'lbry-redux';
-import { selectUserVerifiedEmail, selectGetSyncErrorMessage, selectUserEmail } from 'lbryinc';
+import {
+ selectUserVerifiedEmail,
+ selectGetSyncErrorMessage,
+ selectUserEmail,
+ doClearEmailEntry,
+ doClearPasswordEntry,
+} from 'lbryinc';
import { doSetClientSetting } from 'redux/actions/settings';
import { doSignOut, doOpenModal } from 'redux/actions/app';
import { makeSelectClientSetting } from 'redux/selectors/settings';
@@ -26,6 +32,8 @@ const perform = dispatch => ({
openMobileNavigation: () => dispatch(doOpenModal(MODALS.MOBILE_NAVIGATION)),
openChannelCreate: () => dispatch(doOpenModal(MODALS.CREATE_CHANNEL)),
openSignOutModal: () => dispatch(doOpenModal(MODALS.SIGN_OUT)),
+ clearEmailEntry: () => dispatch(doClearEmailEntry()),
+ clearPasswordEntry: () => dispatch(doClearPasswordEntry()),
});
export default connect(select, perform)(Header);
diff --git a/ui/component/header/view.jsx b/ui/component/header/view.jsx
index d19cae5f2..df580c373 100644
--- a/ui/component/header/view.jsx
+++ b/ui/component/header/view.jsx
@@ -40,6 +40,8 @@ type Props = {
openMobileNavigation: () => void,
openChannelCreate: () => void,
openSignOutModal: () => void,
+ clearEmailEntry: () => void,
+ clearPasswordEntry: () => void,
};
const Header = (props: Props) => {
@@ -58,6 +60,8 @@ const Header = (props: Props) => {
openMobileNavigation,
openChannelCreate,
openSignOutModal,
+ clearEmailEntry,
+ clearPasswordEntry,
} = props;
// on the verify page don't let anyone escape other than by closing the tab to keep session data consistent
@@ -66,7 +70,16 @@ const Header = (props: Props) => {
// Sign out if they click the "x" when they are on the password prompt
const authHeaderAction = syncError ? { onClick: signOut } : { navigate: '/' };
const homeButtonNavigationProps = isVerifyPage ? {} : authHeader ? authHeaderAction : { navigate: '/' };
- const closeButtonNavigationProps = authHeader ? authHeaderAction : { onClick: () => history.goBack() };
+ const closeButtonNavigationProps = {
+ onClick: () => {
+ clearEmailEntry();
+ clearPasswordEntry();
+
+ if (syncError) {
+ signOut();
+ }
+ },
+ };
function handleThemeToggle() {
if (automaticDarkModeEnabled) {
@@ -239,7 +252,12 @@ const Header = (props: Props) => {
{/* This pushes the close button to the right side */}
-
+
)
diff --git a/ui/component/router/view.jsx b/ui/component/router/view.jsx
index 0ccf89aae..943e7e177 100644
--- a/ui/component/router/view.jsx
+++ b/ui/component/router/view.jsx
@@ -29,7 +29,6 @@ import ListBlockedPage from 'page/listBlocked';
import FourOhFourPage from 'page/fourOhFour';
import SignInPage from 'page/signIn';
import SignUpPage from 'page/signUp';
-import PasswordResetPage from 'page/passwordReset';
import PasswordSetPage from 'page/passwordSet';
import SignInVerifyPage from 'page/signInVerify';
import ChannelsPage from 'page/channels';
@@ -156,7 +155,6 @@ function AppRouter(props: Props) {
-
diff --git a/ui/component/settingAccountPassword/index.js b/ui/component/settingAccountPassword/index.js
index 40a78ad69..b66d1f30d 100644
--- a/ui/component/settingAccountPassword/index.js
+++ b/ui/component/settingAccountPassword/index.js
@@ -5,7 +5,7 @@ import {
selectPasswordSetSuccess,
selectPasswordSetError,
doUserPasswordSet,
- doClearPasswordEntries,
+ doClearPasswordEntry,
} from 'lbryinc';
import { doToast } from 'lbry-redux';
import UserSignIn from './view';
@@ -20,5 +20,5 @@ const select = state => ({
export default connect(select, {
doUserPasswordSet,
doToast,
- doClearPasswordEntries,
+ doClearPasswordEntry,
})(UserSignIn);
diff --git a/ui/component/settingAccountPassword/view.jsx b/ui/component/settingAccountPassword/view.jsx
index 1165f504a..0b444095b 100644
--- a/ui/component/settingAccountPassword/view.jsx
+++ b/ui/component/settingAccountPassword/view.jsx
@@ -9,7 +9,7 @@ type Props = {
user: ?User,
doToast: ({ message: string }) => void,
doUserPasswordSet: (string, ?string) => void,
- doClearPasswordEntries: () => void,
+ doClearPasswordEntry: () => void,
passwordSetPending: boolean,
passwordSetSuccess: boolean,
passwordSetError: ?string,
@@ -23,7 +23,7 @@ export default function SettingAccountPassword(props: Props) {
// passwordSetPending,
passwordSetSuccess,
passwordSetError,
- doClearPasswordEntries,
+ doClearPasswordEntry,
} = props;
const [oldPassword, setOldPassword] = useState('');
const [newPassword, setNewPassword] = useState('');
@@ -40,11 +40,11 @@ export default function SettingAccountPassword(props: Props) {
doToast({
message: __('Password updated successfully.'),
});
- doClearPasswordEntries();
+ doClearPasswordEntry();
setOldPassword('');
setNewPassword('');
}
- }, [passwordSetSuccess, setOldPassword, setNewPassword, doClearPasswordEntries, doToast]);
+ }, [passwordSetSuccess, setOldPassword, setNewPassword, doClearPasswordEntry, doToast]);
return (
+
+
+ ),
+ }}
+ >
+ By continuing, I agree to the %terms% and confirm I am over the age of 13.
+
+
- {errorMessage && (
-
- {errorMessage}
-
- )}
}
+ nag={errorMessage && {errorMessage}} />}
/>
-
-
- ,
- }}
- >
- By continuing, I agree to the %terms% and confirm I am over the age of 13.
-
-
-
);
}
diff --git a/ui/component/userEmailVerify/view.jsx b/ui/component/userEmailVerify/view.jsx
index 5315fd2b7..446904f59 100644
--- a/ui/component/userEmailVerify/view.jsx
+++ b/ui/component/userEmailVerify/view.jsx
@@ -76,29 +76,29 @@ class UserEmailVerify extends React.PureComponent {
}
actions={
-
-
-
-
+
+
+
+
+
+
+ ,
+ chat_link: ,
+ }}
+ >
+ Email %help_link% or join our %chat_link% if you encounter any trouble verifying.
+
+
+
}
/>
-
-
- ,
- chat_link: ,
- }}
- >
- Email %help_link% or join our %chat_link% if you encounter any trouble verifying.
-
-
-
);
}
diff --git a/ui/component/userPasswordReset/index.js b/ui/component/userPasswordReset/index.js
index ecd39d97f..af7e940da 100644
--- a/ui/component/userPasswordReset/index.js
+++ b/ui/component/userPasswordReset/index.js
@@ -4,7 +4,8 @@ import {
selectPasswordResetSuccess,
selectPasswordResetIsPending,
selectPasswordResetError,
- doClearPasswordEntries,
+ doClearPasswordEntry,
+ doClearEmailEntry,
} from 'lbryinc';
import { doToast } from 'lbry-redux';
import UserSignIn from './view';
@@ -18,5 +19,6 @@ const select = state => ({
export default connect(select, {
doUserPasswordReset,
doToast,
- doClearPasswordEntries,
+ doClearPasswordEntry,
+ doClearEmailEntry,
})(UserSignIn);
diff --git a/ui/component/userPasswordReset/view.jsx b/ui/component/userPasswordReset/view.jsx
index cc4a3b857..a66a237ca 100644
--- a/ui/component/userPasswordReset/view.jsx
+++ b/ui/component/userPasswordReset/view.jsx
@@ -14,7 +14,8 @@ type Props = {
user: ?User,
doToast: ({ message: string }) => void,
doUserPasswordReset: string => void,
- doClearPasswordEntries: () => void,
+ doClearPasswordEntry: () => void,
+ doClearEmailEntry: () => void,
passwordResetPending: boolean,
passwordResetSuccess: boolean,
passwordResetError: ?string,
@@ -27,9 +28,10 @@ function UserPasswordReset(props: Props) {
passwordResetError,
passwordResetSuccess,
doToast,
- doClearPasswordEntries,
+ doClearPasswordEntry,
+ doClearEmailEntry,
} = props;
- const { location, replace } = useHistory();
+ const { location, push } = useHistory();
const { search } = location;
const urlParams = new URLSearchParams(search);
const defaultEmail = urlParams.get('email');
@@ -44,8 +46,9 @@ function UserPasswordReset(props: Props) {
function handleRestart() {
setEmail('');
- doClearPasswordEntries();
- replace();
+ doClearPasswordEntry();
+ doClearEmailEntry();
+ push(`/$/${PAGES.AUTH_SIGNIN}`);
}
React.useEffect(() => {
@@ -83,27 +86,21 @@ function UserPasswordReset(props: Props) {
label={passwordResetPending ? __('Resetting') : __('Reset Password')}
disabled={!email || !valid || passwordResetPending || passwordResetSuccess}
/>
- {passwordResetSuccess && }
+
{passwordResetPending && }
- {passwordResetError && (
-
- {passwordResetError}
-
- )}
}
nag={
- passwordResetSuccess && (
-
- )
+
+ {passwordResetError && {passwordResetError}} />}
+ {passwordResetSuccess && (
+
+ )}
+
}
/>
-
-
-
-
);
}
diff --git a/ui/component/userPasswordSet/view.jsx b/ui/component/userPasswordSet/view.jsx
index fc49d5ab1..70838a524 100644
--- a/ui/component/userPasswordSet/view.jsx
+++ b/ui/component/userPasswordSet/view.jsx
@@ -93,7 +93,7 @@ function UserPasswordReset(props: Props) {
label={loading ? __('Update Password') : __('Updating Password')}
disabled={!password || loading}
/>
- {error && }
+
{loading && }
@@ -101,10 +101,6 @@ function UserPasswordReset(props: Props) {
}
nag={error && {error}} />}
/>
-
-
-
-
);
}
diff --git a/ui/component/userSignIn/view.jsx b/ui/component/userSignIn/view.jsx
index b8d1485e0..e63b91849 100644
--- a/ui/component/userSignIn/view.jsx
+++ b/ui/component/userSignIn/view.jsx
@@ -40,13 +40,13 @@ function UserSignIn(props: Props) {
return (
- {!showLoading && (
+ {(showEmail || showPassword) && (
{showEmail && }
{showPassword && setEmailOnlyLogin(true)} />}
)}
- {showLoading && (
+ {!showEmail && !showPassword && showLoading && (
diff --git a/ui/component/userSignInPassword/view.jsx b/ui/component/userSignInPassword/view.jsx
index 1d9777a35..03d6d1e65 100644
--- a/ui/component/userSignInPassword/view.jsx
+++ b/ui/component/userSignInPassword/view.jsx
@@ -1,11 +1,11 @@
// @flow
-import * as PAGES from 'constants/pages';
import React, { useState } from 'react';
import { FormField, Form } from 'component/common/form';
import Button from 'component/button';
import Card from 'component/common/card';
import analytics from 'analytics';
import Nag from 'component/common/nag';
+import UserPasswordReset from 'component/userPasswordReset';
type Props = {
errorMessage: ?string,
@@ -16,8 +16,9 @@ type Props = {
};
export default function UserSignInPassword(props: Props) {
- const { errorMessage, doUserSignIn, emailToVerify, doClearEmailEntry, onHandleEmailOnly } = props;
+ const { errorMessage, doUserSignIn, emailToVerify, onHandleEmailOnly } = props;
const [password, setPassword] = useState('');
+ const [forgotPassword, setForgotPassword] = React.useState(false);
function handleSubmit() {
if (emailToVerify) {
@@ -32,11 +33,13 @@ export default function UserSignInPassword(props: Props) {
return (
-
+ {forgotPassword ? (
+
+ ) : (
+
setPassword(e.target.value)}
+ helper={ setForgotPassword(true)} />}
/>
@@ -54,18 +58,10 @@ export default function UserSignInPassword(props: Props) {
-
- }
- nag={errorMessage && }
- />
-
- }
/>
-
-
+ )}
);
}
diff --git a/ui/component/userSignOutButton/index.js b/ui/component/userSignOutButton/index.js
index 4fa19d951..b4f98eda7 100644
--- a/ui/component/userSignOutButton/index.js
+++ b/ui/component/userSignOutButton/index.js
@@ -1,14 +1,12 @@
import { connect } from 'react-redux';
import { doSignOut } from 'redux/actions/app';
+import { doClearEmailEntry, doClearPasswordEntry } from 'lbryinc';
import UserSignOutButton from './view';
const select = state => ({});
-const perform = dispatch => ({
- signOut: () => dispatch(doSignOut()),
-});
-
-export default connect(
- select,
- perform
-)(UserSignOutButton);
+export default connect(select, {
+ doSignOut,
+ doClearEmailEntry,
+ doClearPasswordEntry,
+})(UserSignOutButton);
diff --git a/ui/component/userSignOutButton/view.jsx b/ui/component/userSignOutButton/view.jsx
index b624f1b33..ca0dbfc92 100644
--- a/ui/component/userSignOutButton/view.jsx
+++ b/ui/component/userSignOutButton/view.jsx
@@ -5,13 +5,25 @@ import Button from 'component/button';
type Props = {
button: string,
label?: string,
- signOut: () => void,
+ doSignOut: () => void,
+ doClearEmailEntry: () => void,
+ doClearPasswordEntry: () => void,
};
function UserSignOutButton(props: Props) {
- const { button = 'link', signOut, label } = props;
+ const { button = 'link', doSignOut, doClearEmailEntry, doClearPasswordEntry, label } = props;
- return ;
+ return (
+ {
+ doClearPasswordEntry();
+ doClearEmailEntry();
+ doSignOut();
+ }}
+ />
+ );
}
export default UserSignOutButton;
diff --git a/ui/constants/pages.js b/ui/constants/pages.js
index 91b0d7a2b..dd71323cc 100644
--- a/ui/constants/pages.js
+++ b/ui/constants/pages.js
@@ -1,8 +1,7 @@
exports.AUTH = 'signup';
exports.AUTH_SIGNIN = 'signin';
exports.AUTH_VERIFY = 'verify';
-exports.AUTH_PASSWORD_RESET = 'password-reset';
-exports.AUTH_PASSWORD_SET = 'reset'; // Change this in internal-apis
+exports.AUTH_PASSWORD_SET = 'reset';
exports.BACKUP = 'backup';
exports.CHANNEL = 'channel';
exports.DISCOVER = 'discover';
diff --git a/ui/page/passwordReset/index.js b/ui/page/passwordReset/index.js
deleted file mode 100644
index e3cf8568c..000000000
--- a/ui/page/passwordReset/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import PasswordResetPage from './view';
-
-export default PasswordResetPage;
diff --git a/ui/page/passwordReset/view.jsx b/ui/page/passwordReset/view.jsx
deleted file mode 100644
index 3fe6f33e5..000000000
--- a/ui/page/passwordReset/view.jsx
+++ /dev/null
@@ -1,12 +0,0 @@
-// @flow
-import React from 'react';
-import UserPasswordReset from 'component/userPasswordReset';
-import Page from 'component/page';
-
-export default function PasswordResetPage() {
- return (
-
-
-
- );
-}
diff --git a/ui/scss/component/_button.scss b/ui/scss/component/_button.scss
index bf674ba7d..764aac5c1 100644
--- a/ui/scss/component/_button.scss
+++ b/ui/scss/component/_button.scss
@@ -46,6 +46,11 @@
}
}
+.button--header-close {
+ background-color: var(--color-primary-alt);
+ padding: var(--spacing-small);
+}
+
.button--download-link {
.button__label {
white-space: normal;
diff --git a/ui/scss/component/_modal.scss b/ui/scss/component/_modal.scss
index 51295e915..a3f87a96f 100644
--- a/ui/scss/component/_modal.scss
+++ b/ui/scss/component/_modal.scss
@@ -1,7 +1,9 @@
.ReactModal__Body--open {
#app {
- height: 100vh;
- overflow-y: hidden;
+ @media (max-width: $breakpoint-small) {
+ height: 100vh;
+ overflow-y: hidden;
+ }
}
}
diff --git a/ui/scss/init/_gui.scss b/ui/scss/init/_gui.scss
index ec397074b..24ed8228b 100644
--- a/ui/scss/init/_gui.scss
+++ b/ui/scss/init/_gui.scss
@@ -201,7 +201,7 @@ img {
display: block;
font-size: var(--font-small);
color: var(--color-text-help);
- margin-top: var(--spacing-miniscule);
+ margin-top: var(--spacing-small);
margin-bottom: var(--spacing-small);
}
diff --git a/yarn.lock b/yarn.lock
index d70251459..2aa2dee46 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -819,10 +819,10 @@
prop-types "^15.6.2"
scheduler "^0.18.0"
-"@lbry/components@^4.1.1":
- version "4.1.1"
- resolved "https://registry.yarnpkg.com/@lbry/components/-/components-4.1.1.tgz#5830fa0321565965ede3c48ff39518cb24691b3a"
- integrity sha512-XgeA6q4vnmRHNkM4M5BddRqsIn9DkLgozjhoGuY5j1hnQcyYim3X+pxa7IASL/iS8jOre9JzPDp1bG0HaRgF8w==
+"@lbry/components@^4.1.2":
+ version "4.1.2"
+ resolved "https://registry.yarnpkg.com/@lbry/components/-/components-4.1.2.tgz#18eda2f1a73a6241e9a96594ccab8fffb9ef3ae9"
+ integrity sha512-GJx4BTdEtOlm5/JsKUVXBzYeepXTbZ4GjGFrKxzXh6jWw40aFOh8OrHwYM/LHRl1fuKRmB5xpZNWsjw6EKyEeQ==
"@mapbox/hast-util-table-cell-style@^0.1.3":
version "0.1.3"
@@ -6147,9 +6147,9 @@ lbry-redux@lbryio/lbry-redux#1097a63d44a20b87e443fbaa48f95fe3ea5e3f70:
reselect "^3.0.0"
uuid "^3.3.2"
-lbryinc@lbryio/lbryinc#75f992ef02ddef3e1cfe3a6632710fffd04b0c68:
+lbryinc@lbryio/lbryinc#12aefaa14343d2f3eac01f2683701f58e53f1848:
version "0.0.1"
- resolved "https://codeload.github.com/lbryio/lbryinc/tar.gz/75f992ef02ddef3e1cfe3a6632710fffd04b0c68"
+ resolved "https://codeload.github.com/lbryio/lbryinc/tar.gz/12aefaa14343d2f3eac01f2683701f58e53f1848"
dependencies:
reselect "^3.0.0"
--
2.45.3
From 375567862966da7dba0c1afe288ec6f45b31f9c5 Mon Sep 17 00:00:00 2001
From: Sean Yesmunt
Date: Mon, 13 Apr 2020 14:20:30 -0400
Subject: [PATCH 13/15] slightly improve close button on sign up page
---
package.json | 2 +-
ui/component/header/view.jsx | 5 +++++
ui/component/settingAccountPassword/index.js | 2 --
ui/component/settingAccountPassword/view.jsx | 11 +----------
4 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/package.json b/package.json
index 97ca2d7ee..47eb26d92 100644
--- a/package.json
+++ b/package.json
@@ -27,7 +27,7 @@
"dev:electron": "cross-env NODE_ENV=development node ./electron/devServer.js",
"dev:web": "cd ./lbrytv && yarn dev",
"dev:web-server": "cross-env NODE_ENV=development yarn compile:web && concurrently \"cross-env NODE_ENV=development yarn compile:web --watch\" \"cd ./lbrytv && yarn dev:server\"",
- "dev:internal-apis": "LBRY_API_URL='http://' yarn dev:web",
+ "dev:internal-apis": "LBRY_API_URL='http://localhost:8080' yarn dev:electron",
"dev:iatv": "LBRY_API_URL='http://localhost:15400' SDK_API_URL='http://localhost:15100' yarn dev:web",
"run:web": "cross-env NODE_ENV=production yarn compile:web && node ./dist/web/server.js",
"run:web-server": "cross-env NODE_ENV=production yarn compile:web && cd ./lbrytv && yarn dev:server",
diff --git a/ui/component/header/view.jsx b/ui/component/header/view.jsx
index df580c373..872631056 100644
--- a/ui/component/header/view.jsx
+++ b/ui/component/header/view.jsx
@@ -66,6 +66,7 @@ const Header = (props: Props) => {
// on the verify page don't let anyone escape other than by closing the tab to keep session data consistent
const isVerifyPage = history.location.pathname.includes(PAGES.AUTH_VERIFY);
+ const isSignUpPage = history.location.pathname.includes(PAGES.AUTH);
// Sign out if they click the "x" when they are on the password prompt
const authHeaderAction = syncError ? { onClick: signOut } : { navigate: '/' };
@@ -75,6 +76,10 @@ const Header = (props: Props) => {
clearEmailEntry();
clearPasswordEntry();
+ if (isSignUpPage) {
+ history.goBack();
+ }
+
if (syncError) {
signOut();
}
diff --git a/ui/component/settingAccountPassword/index.js b/ui/component/settingAccountPassword/index.js
index b66d1f30d..180f05cde 100644
--- a/ui/component/settingAccountPassword/index.js
+++ b/ui/component/settingAccountPassword/index.js
@@ -1,7 +1,6 @@
import { connect } from 'react-redux';
import {
selectUser,
- selectPasswordSetIsPending,
selectPasswordSetSuccess,
selectPasswordSetError,
doUserPasswordSet,
@@ -12,7 +11,6 @@ import UserSignIn from './view';
const select = state => ({
user: selectUser(state),
- passwordSetPending: selectPasswordSetIsPending(state),
passwordSetSuccess: selectPasswordSetSuccess(state),
passwordSetError: selectPasswordSetError(state),
});
diff --git a/ui/component/settingAccountPassword/view.jsx b/ui/component/settingAccountPassword/view.jsx
index 0b444095b..20f4deb13 100644
--- a/ui/component/settingAccountPassword/view.jsx
+++ b/ui/component/settingAccountPassword/view.jsx
@@ -10,21 +10,12 @@ type Props = {
doToast: ({ message: string }) => void,
doUserPasswordSet: (string, ?string) => void,
doClearPasswordEntry: () => void,
- passwordSetPending: boolean,
passwordSetSuccess: boolean,
passwordSetError: ?string,
};
export default function SettingAccountPassword(props: Props) {
- const {
- user,
- doToast,
- doUserPasswordSet,
- // passwordSetPending,
- passwordSetSuccess,
- passwordSetError,
- doClearPasswordEntry,
- } = props;
+ const { user, doToast, doUserPasswordSet, passwordSetSuccess, passwordSetError, doClearPasswordEntry } = props;
const [oldPassword, setOldPassword] = useState('');
const [newPassword, setNewPassword] = useState('');
const [isAddingPassword, setIsAddingPassword] = useState(false);
--
2.45.3
From 2cfafceae770d7bb1f512d70fb188666e2aadd66 Mon Sep 17 00:00:00 2001
From: Sean Yesmunt
Date: Mon, 13 Apr 2020 14:45:34 -0400
Subject: [PATCH 14/15] moar fixes
---
static/app-strings.json | 4 +---
ui/component/header/index.js | 2 ++
ui/component/header/view.jsx | 11 +++++++++--
ui/component/userEmailReturning/view.jsx | 4 ++--
4 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/static/app-strings.json b/static/app-strings.json
index 580d25ed4..2981c0ccd 100644
--- a/static/app-strings.json
+++ b/static/app-strings.json
@@ -1117,9 +1117,7 @@
"File Description": "File Description",
"View %count% reposts": "View %count% reposts",
"Preparing your content": "Preparing your content",
- "Sign Up with lbry.tv": "Sign Up with lbry.tv",
"Already have an account? %sign_in%": "Already have an account? %sign_in%",
"Sign in with a password (optional)": "Sign in with a password (optional)",
- "Sign Up": "Sign Up",
"Don't have an account? %sign_up%": "Don't have an account? %sign_up%"
-}
\ No newline at end of file
+}
diff --git a/ui/component/header/index.js b/ui/component/header/index.js
index 6c0ea9f26..b77d624ab 100644
--- a/ui/component/header/index.js
+++ b/ui/component/header/index.js
@@ -8,6 +8,7 @@ import {
selectUserEmail,
doClearEmailEntry,
doClearPasswordEntry,
+ selectEmailToVerify,
} from 'lbryinc';
import { doSetClientSetting } from 'redux/actions/settings';
import { doSignOut, doOpenModal } from 'redux/actions/app';
@@ -24,6 +25,7 @@ const select = state => ({
authenticated: selectUserVerifiedEmail(state),
email: selectUserEmail(state),
syncError: selectGetSyncErrorMessage(state),
+ emailToVerify: selectEmailToVerify(state),
});
const perform = dispatch => ({
diff --git a/ui/component/header/view.jsx b/ui/component/header/view.jsx
index 872631056..124aa9b1b 100644
--- a/ui/component/header/view.jsx
+++ b/ui/component/header/view.jsx
@@ -36,6 +36,7 @@ type Props = {
authenticated: boolean,
authHeader: boolean,
syncError: ?string,
+ emailToVerify?: string,
signOut: () => void,
openMobileNavigation: () => void,
openChannelCreate: () => void,
@@ -62,11 +63,13 @@ const Header = (props: Props) => {
openSignOutModal,
clearEmailEntry,
clearPasswordEntry,
+ emailToVerify,
} = props;
// on the verify page don't let anyone escape other than by closing the tab to keep session data consistent
const isVerifyPage = history.location.pathname.includes(PAGES.AUTH_VERIFY);
const isSignUpPage = history.location.pathname.includes(PAGES.AUTH);
+ const isSignInPage = history.location.pathname.includes(PAGES.AUTH_SIGNIN);
// Sign out if they click the "x" when they are on the password prompt
const authHeaderAction = syncError ? { onClick: signOut } : { navigate: '/' };
@@ -76,6 +79,10 @@ const Header = (props: Props) => {
clearEmailEntry();
clearPasswordEntry();
+ if (isSignInPage && !emailToVerify) {
+ history.goBack();
+ }
+
if (isSignUpPage) {
history.goBack();
}
@@ -258,8 +265,8 @@ const Header = (props: Props) => {
diff --git a/ui/component/userEmailReturning/view.jsx b/ui/component/userEmailReturning/view.jsx
index eef1a9674..3952df6eb 100644
--- a/ui/component/userEmailReturning/view.jsx
+++ b/ui/component/userEmailReturning/view.jsx
@@ -93,8 +93,8 @@ function UserEmailReturning(props: Props) {
)}
{!emailExistsFromUrl && !emailDoesNotExist && errorMessage && (
--
2.45.3
From 4dc3ceb30c6c373f0f9a526af1e9ae7574bfd3ee Mon Sep 17 00:00:00 2001
From: Sean Yesmunt
Date: Mon, 13 Apr 2020 14:53:47 -0400
Subject: [PATCH 15/15] fix password autofil
---
ui/component/userPasswordReset/index.js | 2 ++
ui/component/userPasswordReset/view.jsx | 9 ++++-----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/ui/component/userPasswordReset/index.js b/ui/component/userPasswordReset/index.js
index af7e940da..f6799bd8d 100644
--- a/ui/component/userPasswordReset/index.js
+++ b/ui/component/userPasswordReset/index.js
@@ -6,6 +6,7 @@ import {
selectPasswordResetError,
doClearPasswordEntry,
doClearEmailEntry,
+ selectEmailToVerify,
} from 'lbryinc';
import { doToast } from 'lbry-redux';
import UserSignIn from './view';
@@ -14,6 +15,7 @@ const select = state => ({
passwordResetSuccess: selectPasswordResetSuccess(state),
passwordResetIsPending: selectPasswordResetIsPending(state),
passwordResetError: selectPasswordResetError(state),
+ emailToVerify: selectEmailToVerify(state),
});
export default connect(select, {
diff --git a/ui/component/userPasswordReset/view.jsx b/ui/component/userPasswordReset/view.jsx
index a66a237ca..98f464d35 100644
--- a/ui/component/userPasswordReset/view.jsx
+++ b/ui/component/userPasswordReset/view.jsx
@@ -19,6 +19,7 @@ type Props = {
passwordResetPending: boolean,
passwordResetSuccess: boolean,
passwordResetError: ?string,
+ emailToVerify: ?string,
};
function UserPasswordReset(props: Props) {
@@ -30,12 +31,10 @@ function UserPasswordReset(props: Props) {
doToast,
doClearPasswordEntry,
doClearEmailEntry,
+ emailToVerify,
} = props;
- const { location, push } = useHistory();
- const { search } = location;
- const urlParams = new URLSearchParams(search);
- const defaultEmail = urlParams.get('email');
- const [email, setEmail] = React.useState(defaultEmail || '');
+ const { push } = useHistory();
+ const [email, setEmail] = React.useState(emailToVerify || '');
const valid = email.match(EMAIL_REGEX);
function handleSubmit() {
--
2.45.3