Fixing last couple of auth dialogs
This commit is contained in:
@@ -2,13 +2,13 @@ import React from 'react'
|
||||
import { api } from 'src/API'
|
||||
import PropTypes from 'prop-types'
|
||||
import { MessageModal, WaitModal } from '../Modal'
|
||||
import { Logout } from '.'
|
||||
import autobind from 'autobind-decorator'
|
||||
|
||||
export class ConfirmEmail extends React.Component {
|
||||
static propTypes = {
|
||||
history: PropTypes.oneOfType([PropTypes.array, PropTypes.object])
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super()
|
||||
this.state = {
|
||||
@@ -22,7 +22,9 @@ export class ConfirmEmail extends React.Component {
|
||||
|
||||
this.setState({ waitModal: { message: 'Validating Email...' } })
|
||||
if (emailToken) {
|
||||
api.confirmEmail(emailToken).then((response) => {
|
||||
api.logout().then(() => {
|
||||
return api.confirmEmail(emailToken)
|
||||
}).then((response) => {
|
||||
this.setState({ waitModal: null })
|
||||
if (response && response.passwordToken) {
|
||||
// API will send a password reset token if this is the first time loggin on
|
||||
@@ -54,10 +56,6 @@ export class ConfirmEmail extends React.Component {
|
||||
render() {
|
||||
const { messageModal, waitModal } = this.state
|
||||
|
||||
if (api.loggedInUser) {
|
||||
return <Logout redirect={`${window.location.pathname}${window.location.search}`} />
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<WaitModal
|
||||
|
||||
Reference in New Issue
Block a user