merge from local

This commit is contained in:
SrGooglo 2024-04-15 17:03:35 +00:00
parent 06aee646ca
commit 7619c1f4d9
2 changed files with 30 additions and 11 deletions

@ -1 +1 @@
Subproject commit 126bad9c1e21c0c7fcab60a22fc9d70bbbd9a999 Subproject commit 4911d7b1af76b1a06c52d14151bf70f09feda030

View File

@ -30,7 +30,7 @@ const phasesToSteps = {
1: "password", 1: "password",
} }
export default class Login extends React.Component { class Login extends React.Component {
static pageStatement = { static pageStatement = {
bottomBarAllowed: false bottomBarAllowed: false
} }
@ -41,6 +41,7 @@ export default class Login extends React.Component {
error: null, error: null,
phase: 0, phase: 0,
mfa_required: null, mfa_required: null,
forbidden: false,
} }
formRef = React.createRef() formRef = React.createRef()
@ -60,14 +61,10 @@ export default class Login extends React.Component {
this.toggleLoading(true) this.toggleLoading(true)
await AuthModel.login(payload, this.onDone).catch((error) => { await AuthModel.login(payload, this.onDone).catch((error) => {
if (error.response.data){ if (error.response.data) {
if (error.response.data.violation) { if (error.response.data.violation) {
this.props.close({ return this.setState({
unlock: true forbidden: error.response.data.violation
})
return app.history.push("/violation", {
violation: error.response.data.violation
}) })
} }
} }
@ -157,7 +154,7 @@ export default class Login extends React.Component {
value = value.toLowerCase() value = value.toLowerCase()
value = value.trim() value = value.trim()
} }
// remove error from ref // remove error from ref
this.formRef.current.setFields([ this.formRef.current.setFields([
{ {
@ -235,6 +232,22 @@ export default class Login extends React.Component {
} }
render() { render() {
if (this.state.forbidden) {
return <div className="login_wrapper">
<div className="content">
<h1>Access denied</h1>
<h3>Your account has been disabled due a violation to our terms of service</h3>
<p>Here is a detailed description of the violation</p>
<div className="field-error">
{this.state.forbidden.reason}
</div>
<p>If you think this is an error, or you want to apeel this decision please contact our support</p>
</div>
</div>
}
return <div className="login_wrapper"> return <div className="login_wrapper">
<div className="content"> <div className="content">
<h1> <h1>
@ -345,4 +358,10 @@ export default class Login extends React.Component {
</div> </div>
</div> </div>
} }
} }
const ForwardedLogin = (props) => {
return <Login {...props} />
}
export default ForwardedLogin