Improve login flow

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2024-06-13 17:49:18 +02:00
parent bdc5983616
commit 9e6be3f790
Signed by: luzifer
SSH Key Fingerprint: SHA256:/xtE5lCgiRDQr8SLxHMS92ZBlACmATUmF1crK16Ks4E
2 changed files with 3 additions and 1 deletions

View File

@ -7,7 +7,7 @@
:disabled="loading"
@click="openAuthURL"
>
<i class="fab fa-twitch fa-fw me-1" />
<i :class="{'fa-fw me-1': true, 'fab fa-twitch': !loading, 'fas fa-circle-notch fa-spin': loading }" />
Login with Twitch
</button>
</div>

View File

@ -67,6 +67,7 @@ const app = createApp({
// User token is not valid and therefore should be removed
// which essentially triggers a logout
this.logout()
throw new Error('user has been logged out')
}
return resp
@ -146,6 +147,7 @@ const app = createApp({
})
.then((resp: Response): any => {
if (resp.status !== 200) {
this.$root.bus.emit('login-processing', false)
throw new Error(`login failed, status=${resp.status}`)
}