Skip to content

Commit

Permalink
feat: show error message if authentication has failed (#121)
Browse files Browse the repository at this point in the history
Fixes #108
  • Loading branch information
akdasa authored Feb 3, 2023
1 parent 533c43e commit 648ebb6
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 6 deletions.
13 changes: 11 additions & 2 deletions src/app/settings/components/account/email/LogInViaEmailPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@
:message="$t('common.wait')"
@did-dismiss="inProgress = false"
/>

<ion-alert
:is-open="loginFailedDialogOpen"
:header="$t('account.logInFailed.title')"
:message="$t('account.loginFailed.message')"
:buttons="[$t('common.ok')]"
@did-dismiss="loginFailedDialogOpen=false"
/>
</ion-content>
</ion-page>
</template>
Expand All @@ -66,7 +74,7 @@
import {
IonButton, IonContent, IonHeader, IonInput, IonItem,
IonLabel, IonList, IonLoading, IonPage, IonTitle,
IonToolbar, IonButtons, modalController
IonToolbar, IonButtons, modalController, IonAlert
} from '@ionic/vue'
import { ref } from 'vue'
import { storeToRefs } from 'pinia'
Expand All @@ -78,6 +86,7 @@ const account = useAccountStore()
const { email, password, token } = storeToRefs(account)
const inProgress = ref(false)
const loginFailedDialogOpen = ref(false)
async function onLogIn() {
inProgress.value = true
Expand All @@ -89,7 +98,7 @@ async function onLogIn() {
token.value = result.value
modalController.dismiss(null, 'ok')
} else {
console.log("Ero")
loginFailedDialogOpen.value = true
}
inProgress.value = false
}
Expand Down
11 changes: 9 additions & 2 deletions src/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"cancel": "Cancel",
"close": "Close",
"revert": "Revert",
"wait": "Please wait..."
"wait": "Please wait...",
"ok": "OK"
},
"decks": {
"inbox": {
Expand Down Expand Up @@ -67,7 +68,13 @@
"password": "Password",
"confirmEmail": "To complete your registration, please confirm that you have received the email that was sent to you. Thank you",
"name": "Name",
"syncTime": "Sync time"
"syncTime": "Sync time",
"logInFailed": {
"title": "Login failed"
},
"loginFailed": {
"message": "Unable to log in using these credentials"
}
},
"tutorial": {
"inbox": {
Expand Down
3 changes: 3 additions & 0 deletions src/locale/rs.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@
"inbox": {
"title": "Инбок"
}
},
"common": {
"ok": "OK"
}
}
12 changes: 10 additions & 2 deletions src/locale/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"cancel": "Отмена",
"close": "Закрыть",
"revert": "Отменить",
"wait": "Пожалуйста подождите..."
"wait": "Пожалуйста подождите...",
"ok": "OK"
},
"decks": {
"inbox": {
Expand Down Expand Up @@ -66,7 +67,14 @@
"refresh": "Обновить токен",
"validTill": "Токен действителен до"
},
"welcomeBack": "Добро пожаловать!"
"welcomeBack": "Добро пожаловать!",
"syncTime": "Синхронизовано",
"loginFailed": {
"message": "Невозможно войти в систему, используя эти учетные данные"
},
"logInFailed": {
"title": "Ошибка входа"
}
},
"tutorial": {
"inbox": {
Expand Down

0 comments on commit 648ebb6

Please sign in to comment.