Browse Source

fix(gui-v2,auth): check if actually signedIn before refreshing

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
pull/2651/head
Braks 2 years ago committed by braks
parent
commit
64fa0c951e
  1. 2
      packages/nc-gui-v2/composables/useGlobalState.ts
  2. 4
      packages/nc-gui-v2/pages/signin.vue

2
packages/nc-gui-v2/composables/useGlobalState.ts

@ -132,7 +132,7 @@ export const useGlobalState = (): GlobalState => {
watch(
() => !!(payload && payload.exp && payload.exp - 5 * 60 < timestamp / 1000),
async (expiring) => {
if (payload && expiring) {
if (signedIn.value && payload && expiring) {
await refreshToken()
}
},

4
packages/nc-gui-v2/pages/signin.vue

@ -103,7 +103,7 @@ const resetError = () => {
:rules="formRules.email"
:label="$t('labels.email')"
:placeholder="$t('labels.email')"
:persistent-placeholder="$t('labels.email')"
:persistent-placeholder="true"
type="text"
@focus="resetError"
/>
@ -115,7 +115,7 @@ const resetError = () => {
:rules="formRules.password"
:label="$t('labels.password')"
:placeholder="$t('labels.password')"
:persistent-placeholder="$t('labels.password')"
:persistent-placeholder="true"
type="password"
@focus="resetError"
/>

Loading…
Cancel
Save