Disallow back button if username forced
This commit is contained in:
parent
4f8c4d641f
commit
f371310620
@ -65,12 +65,14 @@ export default class AuthLoginForm extends Component {
|
|||||||
loading = false
|
loading = false
|
||||||
error_message = ''
|
error_message = ''
|
||||||
other_message = ''
|
other_message = ''
|
||||||
|
allow_back = true
|
||||||
|
|
||||||
watch_username(new_username, old_username) {
|
watch_username(new_username, old_username) {
|
||||||
this.btn_disabled = !new_username
|
this.btn_disabled = !new_username
|
||||||
}
|
}
|
||||||
|
|
||||||
back_click() {
|
back_click() {
|
||||||
|
if ( !this.allow_back ) return;
|
||||||
this.step_two = false
|
this.step_two = false
|
||||||
this.button_text = 'Next'
|
this.button_text = 'Next'
|
||||||
}
|
}
|
||||||
@ -78,6 +80,7 @@ export default class AuthLoginForm extends Component {
|
|||||||
async vue_on_create() {
|
async vue_on_create() {
|
||||||
const auth_user = await auth_api.get_authenticated_user()
|
const auth_user = await auth_api.get_authenticated_user()
|
||||||
if ( auth_user ) {
|
if ( auth_user ) {
|
||||||
|
this.allow_back = false
|
||||||
this.username = auth_user
|
this.username = auth_user
|
||||||
await this.step_click()
|
await this.step_click()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user