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 e8a1b1fb7c
commit f140bd7d92
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" :disabled="loading"
@click="openAuthURL" @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 Login with Twitch
</button> </button>
</div> </div>

View file

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