Fixing last couple of auth dialogs
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import React, { Component, Fragment } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { Box, Text, Image, Column, Row, BoundInput, BoundButton } from 'ui'
|
||||
import { Logout } from '.'
|
||||
import { MessageModal, WaitModal } from '../Modal'
|
||||
import { api } from 'src/API'
|
||||
import { FormBinder } from 'react-form-binder'
|
||||
@@ -47,13 +46,10 @@ export class ResetPassword extends Component {
|
||||
|
||||
this.setState({ waitModal: { message: 'Confirming password reset...' } })
|
||||
if (passwordToken) {
|
||||
api.confirmResetPassword(passwordToken).then((response) => {
|
||||
this.setState({ waitModal: null })
|
||||
if (response && response.valid) {
|
||||
this.setState({ tokenConfirmed: true })
|
||||
} else {
|
||||
this.props.history.replace('/')
|
||||
}
|
||||
api.logout().then(() => {
|
||||
return api.confirmResetPassword(passwordToken)
|
||||
}).then((response) => {
|
||||
this.setState({ waitModal: null, tokenConfirmed: true })
|
||||
}).catch((err) => {
|
||||
this.setState({
|
||||
waitModal: null,
|
||||
@@ -107,10 +103,6 @@ export class ResetPassword extends Component {
|
||||
render() {
|
||||
const { messageModal, waitModal, binder } = this.state
|
||||
|
||||
if (api.loggedInUser) {
|
||||
return <Logout redirect={`${window.location.pathname}${window.location.search}`} />
|
||||
}
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<Column.Item grow />
|
||||
|
||||
Reference in New Issue
Block a user