diff --git a/lib/auth/index.tsx b/lib/auth/index.tsx index c9a3f3635..971c5b658 100644 --- a/lib/auth/index.tsx +++ b/lib/auth/index.tsx @@ -11,6 +11,7 @@ import { viewExternalUrl } from '../utils/url-utils'; type OwnProps = { authPending: boolean; + hasInsecurePassword: boolean; hasInvalidCredentials: boolean; hasLoginError: boolean; login: (username: string, password: string) => any; @@ -76,6 +77,28 @@ export class Auth extends Component { {!this.state.onLine && (

Offline

)} + {this.props.hasInsecurePassword && ( +

+ Your password is insecure and must be{' '} + + reset + + . Passwords must be between 8 and 64 characters long and may not + include your email address, new lines, or tabs. +

+ )} {this.props.hasInvalidCredentials && (

{ auth .authorize(username, password) .then((user: User) => { + if (!validatePassword(password, username)) { + this.setState({ authStatus: 'insecure-password' }); + return; + } if (!user.access_token) { throw new Error('missing access token'); } @@ -96,6 +102,7 @@ class AppWithoutAuth extends Component {