Use netlify identity widget for auth if present
This commit is contained in:
parent
85e0a156fd
commit
36f2596a9e
@ -8,8 +8,6 @@ import styles from "./AuthenticationPage.css";
|
|||||||
export default class AuthenticationPage extends React.Component {
|
export default class AuthenticationPage extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.identity = window.netlifyIdentity;
|
|
||||||
this.state = {user: this.identity && this.identity.gotrue && this.identity.gotrue.currentUser()};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@ -42,7 +40,7 @@ export default class AuthenticationPage extends React.Component {
|
|||||||
const { email, password } = this.state;
|
const { email, password } = this.state;
|
||||||
const errors = {};
|
const errors = {};
|
||||||
if (!email) {
|
if (!email) {
|
||||||
errors.email = 'Make sure to enter your email.';
|
errors.email = 'Make sure to enter your user name';
|
||||||
}
|
}
|
||||||
if (!password) {
|
if (!password) {
|
||||||
errors.password = 'Please enter your password.';
|
errors.password = 'Please enter your password.';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user