Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: screen halt on logging by showing a loader until succesfully logged in (#81) #90

Merged
merged 6 commits into from
Aug 22, 2024
12 changes: 9 additions & 3 deletions src/views/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@
</ion-item>

<div class="ion-padding">
<ion-button color="primary" expand="block" @click="login()">
<ion-button color="primary" expand="block" @click="isLoggingIn ? '' : login()">
{{ $t("Login") }}
<ion-icon slot="end" :icon="arrowForwardOutline" />
<ion-spinner v-if="isLoggingIn" slot="end" name="crescent" data-spinner-size="medium" />
<ion-icon v-else slot="end" :icon="arrowForwardOutline" />
</ion-button>
</div>
</section>
Expand Down Expand Up @@ -64,6 +65,7 @@
IonInput,
IonItem,
IonPage,
IonSpinner,
loadingController
} from "@ionic/vue";
import { defineComponent } from "vue";
Expand All @@ -88,6 +90,7 @@
IonInput,
IonItem,
IonPage,
IonSpinner,
Logo
},
data () {
Expand All @@ -102,7 +105,8 @@
hideBackground: true,
isConfirmingForActiveSession: false,
loader: null as any,
loginOption: {} as any
loginOption: {} as any,
isLoggingIn: false
};
},
ionViewWillEnter() {
Expand Down Expand Up @@ -232,7 +236,7 @@
await this.authStore.setMaargInstance(resp.data.maargInstanceUrl)
}
} catch (error) {
console.error(error)

Check warning on line 239 in src/views/Login.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

Unexpected console statement

Check warning on line 239 in src/views/Login.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

Unexpected console statement
}
},
async login() {
Expand All @@ -242,6 +246,7 @@
return
}

this.isLoggingIn = true;
try {
await this.authStore.login(username.trim(), password)
if (this.authStore.getRedirectUrl) {
Expand All @@ -253,8 +258,9 @@
this.router.push('/')
}
} catch (error) {
console.error(error)

Check warning on line 261 in src/views/Login.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

Unexpected console statement

Check warning on line 261 in src/views/Login.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

Unexpected console statement
}
this.isLoggingIn = false;
},
async samlLogin() {
try {
Expand All @@ -267,7 +273,7 @@
}
} catch (error) {
this.router.push('/')
console.error(error)

Check warning on line 276 in src/views/Login.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

Unexpected console statement

Check warning on line 276 in src/views/Login.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

Unexpected console statement
}
},
async basicLogin() {
Expand Down
Loading