Misc login form improvements

feature/cd
garrettmills 4 years ago
parent 76ba843348
commit af01cd0f5d
No known key found for this signature in database
GPG Key ID: 6ACD58D6ADACFC6E

@ -1,3 +1,2 @@
- MFA recovery codes handling
- OAuth2 -> support refresh tokens
- Traps -> not clearing trust?

@ -45,7 +45,7 @@ const template = `
><a href="#" class="text-secondary" @click="on_register_click">Need an account?</a></small>
<small
class="mr-3"
v-if="!loading"
v-if="!auth_user && !loading"
><a href="#" class="text-secondary" @click="on_forgot_password">Forgot password?</a></small>
<button type="button" class="btn btn-primary" :disabled="loading" v-if="step_two" v-on:click="back_click">Back</button>
<button type="button" class="btn btn-primary" :disabled="loading || btn_disabled" v-on:click="step_click">{{ button_text }}</button>
@ -72,6 +72,7 @@ export default class AuthLoginForm extends Component {
error_message = ''
other_message = ''
allow_back = true
auth_user = false
watch_username(new_username, old_username) {
this.btn_disabled = !new_username
@ -86,6 +87,7 @@ export default class AuthLoginForm extends Component {
async vue_on_create() {
const auth_user = await auth_api.get_authenticated_user()
if ( auth_user ) {
this.auth_user = true
this.allow_back = false
this.username = auth_user
await this.step_click()

@ -1,4 +1,5 @@
import { event_bus } from './EventBus.service.js'
import { auth_api } from './AuthApi.service.js'
class MessageService {
listener_interval = 25000
@ -20,14 +21,16 @@ class MessageService {
return axios.post(`/api/v1/message/banners/read/${banner_id}`)
}
init_listener() {
this.message_ids = []
this.listener = setInterval(() => this._listener_tick(), this.listener_interval)
window.addEventListener('beforeunload', () => this.stop_listener())
try {
this._listener_tick()
} catch (e) {
this.stop_listener()
async init_listener() {
if ( await auth_api.get_authenticated_user() ) {
this.message_ids = []
this.listener = setInterval(() => this._listener_tick(), this.listener_interval)
window.addEventListener('beforeunload', () => this.stop_listener())
try {
this._listener_tick()
} catch (e) {
this.stop_listener()
}
}
}

Loading…
Cancel
Save