diff --git a/src/auth/AuthProvider.tsx b/src/auth/AuthProvider.tsx index 147dec6b0..5fa3a5d22 100644 --- a/src/auth/AuthProvider.tsx +++ b/src/auth/AuthProvider.tsx @@ -9,15 +9,13 @@ import { User } from "./types/User"; import { VerifyToken, VerifyTokenVariables } from "./types/VerifyToken"; interface AuthProviderOperationsProps { - children: ( - props: { - hasToken: boolean; - isAuthenticated: boolean; - tokenAuthLoading: boolean; - tokenVerifyLoading: boolean; - user: User; - } - ) => React.ReactNode; + children: (props: { + hasToken: boolean; + isAuthenticated: boolean; + tokenAuthLoading: boolean; + tokenVerifyLoading: boolean; + user: User; + }) => React.ReactNode; } const AuthProviderOperations: React.StatelessComponent< AuthProviderOperationsProps @@ -41,15 +39,13 @@ const AuthProviderOperations: React.StatelessComponent< }; interface AuthProviderProps { - children: ( - props: { - hasToken: boolean; - isAuthenticated: boolean; - tokenAuthLoading: boolean; - tokenVerifyLoading: boolean; - user: User; - } - ) => React.ReactNode; + children: (props: { + hasToken: boolean; + isAuthenticated: boolean; + tokenAuthLoading: boolean; + tokenVerifyLoading: boolean; + user: User; + }) => React.ReactNode; tokenAuth: PartialMutationProviderOutput; tokenVerify: PartialMutationProviderOutput; } @@ -116,9 +112,16 @@ class AuthProvider extends React.Component< const { children, tokenAuth, tokenVerify } = this.props; const { user } = this.state; const isAuthenticated = !!user; + return ( {children({ hasToken: !!getAuthToken(), diff --git a/src/auth/components/LoginPage/LoginPage.tsx b/src/auth/components/LoginPage/LoginPage.tsx index 76c801638..c94b72433 100644 --- a/src/auth/components/LoginPage/LoginPage.tsx +++ b/src/auth/components/LoginPage/LoginPage.tsx @@ -56,7 +56,13 @@ export interface LoginCardProps extends WithStyles { } const LoginCard = withStyles(styles, { name: "LoginCard" })( - ({ classes, error, disableLoginButton, onSubmit }: LoginCardProps) => { + ({ + classes, + error, + disableLoginButton, + onPasswordRecovery, + onSubmit + }: LoginCardProps) => { const intl = useIntl(); return ( @@ -123,7 +129,7 @@ const LoginCard = withStyles(styles, { name: "LoginCard" })( - + undefined} />); + .add("default", () => ( + undefined} /> + )) + .add("loading", () => ( + undefined} /> + )); diff --git a/src/auth/components/NewPasswordPage/NewPasswordPage.tsx b/src/auth/components/NewPasswordPage/NewPasswordPage.tsx index 5019637d8..2a75498f1 100644 --- a/src/auth/components/NewPasswordPage/NewPasswordPage.tsx +++ b/src/auth/components/NewPasswordPage/NewPasswordPage.tsx @@ -25,6 +25,7 @@ export interface NewPasswordPageFormData { confirmPassword: string; } export interface NewPasswordPageProps { + disabled: boolean; onSubmit: (data: NewPasswordPageFormData) => void; } @@ -34,7 +35,7 @@ const initialForm: NewPasswordPageFormData = { }; const NewPasswordPage: React.FC = props => { - const { onSubmit } = props; + const { disabled, onSubmit } = props; const classes = useStyles(props); const intl = useIntl(); @@ -55,6 +56,7 @@ const NewPasswordPage: React.FC = props => { autoFocus fullWidth autoComplete="none" + disabled={disabled} label={intl.formatMessage({ defaultMessage: "New Password" })} @@ -72,6 +74,7 @@ const NewPasswordPage: React.FC = props => { fullWidth error={passwordError} autoComplete="none" + disabled={disabled} label={intl.formatMessage({ defaultMessage: "Confirm Password" })} @@ -93,7 +96,7 @@ const NewPasswordPage: React.FC = props => {