mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-01-23 06:38:34 +01:00
Convert Info notification to Success & Add an Info notification
This commit is contained in:
parent
8c23aa884f
commit
910e0bc830
@ -217,7 +217,7 @@
|
||||
clearOTP()
|
||||
}
|
||||
|
||||
notify.info({ text: trans('commons.copied_to_clipboard') })
|
||||
notify.success({ text: trans('commons.copied_to_clipboard') })
|
||||
}
|
||||
}
|
||||
|
||||
|
4
resources/js_vue3/stores/notify.js
vendored
4
resources/js_vue3/stores/notify.js
vendored
@ -52,6 +52,10 @@ export const useNotifyStore = defineStore({
|
||||
},
|
||||
|
||||
info(notification) {
|
||||
notify({ type: 'is-info', ...notification})
|
||||
},
|
||||
|
||||
success(notification) {
|
||||
notify({ type: 'is-success', ...notification})
|
||||
},
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
function copyToClipboard(data) {
|
||||
copy(data)
|
||||
notify.info({ text: trans('commons.copied_to_clipboard') })
|
||||
notify.success({ text: trans('commons.copied_to_clipboard') })
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -74,7 +74,7 @@
|
||||
// we fetch the accounts again to prevent the js collection being
|
||||
// desynchronize from the backend php collection
|
||||
fetchAccounts(true)
|
||||
notify.info({ text: trans('twofaccounts.accounts_moved') })
|
||||
notify.success({ text: trans('twofaccounts.accounts_moved') })
|
||||
}
|
||||
|
||||
/**
|
||||
@ -113,7 +113,7 @@
|
||||
if(user.preferences.kickUserAfter == -1) {
|
||||
user.logout()
|
||||
}
|
||||
notify.info({ text: trans('commons.copied_to_clipboard') })
|
||||
notify.success({ text: trans('commons.copied_to_clipboard') })
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@
|
||||
function RenameDevice(e) {
|
||||
renameDeviceForm.patch('/webauthn/credentials/' + deviceId.value + '/name')
|
||||
.then(() => {
|
||||
notify.info({ text: trans('auth.webauthn.device_successfully_registered') })
|
||||
notify.success({ text: trans('auth.webauthn.device_successfully_registered') })
|
||||
router.push({ name: 'accounts' })
|
||||
})
|
||||
}
|
||||
|
@ -37,7 +37,7 @@
|
||||
email: response.data.email,
|
||||
isAdmin: response.data.is_admin,
|
||||
})
|
||||
notify.info({ text: trans('auth.forms.profile_saved') })
|
||||
notify.success({ text: trans('auth.forms.profile_saved') })
|
||||
})
|
||||
.catch(error => {
|
||||
if( error.response.status === 400 ) {
|
||||
@ -59,7 +59,7 @@
|
||||
formPassword.password = ''
|
||||
formPassword.formPassword = ''
|
||||
formPassword.password_confirmation = ''
|
||||
notify.info({ text: response.data.message })
|
||||
notify.success({ text: response.data.message })
|
||||
})
|
||||
.catch(error => {
|
||||
if( error.response.status === 400 ) {
|
||||
@ -79,7 +79,7 @@
|
||||
if(confirm(trans('auth.confirm.delete_account'))) {
|
||||
formDelete.delete('/user', {returnError: true})
|
||||
.then(response => {
|
||||
notify.info({ text: trans('auth.forms.user_account_successfully_deleted') })
|
||||
notify.success({ text: trans('auth.forms.user_account_successfully_deleted') })
|
||||
router.push({ name: 'register' });
|
||||
})
|
||||
.catch(error => {
|
||||
|
@ -18,7 +18,7 @@
|
||||
function updateCredential() {
|
||||
form.patch('/webauthn/credentials/' + props.credentialId + '/name')
|
||||
.then(() => {
|
||||
notify.info({ text: trans('auth.webauthn.device_successfully_registered') })
|
||||
notify.success({ text: trans('auth.webauthn.device_successfully_registered') })
|
||||
router.push({ name: 'settings.webauthn.devices' })
|
||||
})
|
||||
}
|
||||
|
@ -94,14 +94,14 @@
|
||||
.then(response => {
|
||||
// Remove the revoked token from the collection
|
||||
tokens.value = tokens.value.filter(a => a.id !== tokenId)
|
||||
notify.info({ text: trans('settings.token_revoked') })
|
||||
notify.success({ text: trans('settings.token_revoked') })
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function copyToClipboard(data) {
|
||||
copy(data)
|
||||
notify.info({ text: trans('commons.copied_to_clipboard') })
|
||||
notify.success({ text: trans('commons.copied_to_clipboard') })
|
||||
}
|
||||
|
||||
onBeforeRouteLeave((to) => {
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
watch(() => user.preferences.useWebauthnOnly, () => {
|
||||
userService.updatePreference('useWebauthnOnly', user.preferences.useWebauthnOnly).then(response => {
|
||||
notify.info({ text: trans('settings.forms.setting_saved') })
|
||||
notify.success({ text: trans('settings.forms.setting_saved') })
|
||||
})
|
||||
})
|
||||
|
||||
@ -71,7 +71,7 @@
|
||||
user.preferences.useWebauthnOnly = false
|
||||
}
|
||||
|
||||
notify.info({ text: trans('auth.webauthn.device_revoked') })
|
||||
notify.success({ text: trans('auth.webauthn.device_revoked') })
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -125,7 +125,7 @@
|
||||
await form.post('/api/v1/twofaccounts')
|
||||
|
||||
if (form.errors.any() === false) {
|
||||
notify.info({ text: trans('twofaccounts.account_created') })
|
||||
notify.success({ text: trans('twofaccounts.account_created') })
|
||||
router.push({ name: 'accounts' });
|
||||
}
|
||||
}
|
||||
@ -307,7 +307,7 @@
|
||||
*/
|
||||
function copyToClipboard(data) {
|
||||
copy(data)
|
||||
notify.info({ text: trans('commons.copied_to_clipboard') })
|
||||
notify.success({ text: trans('commons.copied_to_clipboard') })
|
||||
}
|
||||
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user