mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-11-09 16:50:01 +00:00
Improve login flow
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
bdc5983616
commit
9e6be3f790
2 changed files with 3 additions and 1 deletions
|
@ -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>
|
||||
|
|
|
@ -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}`)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue