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

Add notification on authenticator verification #1299

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/routes/console/account/mfa.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { sdk } from '$lib/stores/sdk';
import { AuthenticatorType, type Models } from '@appwrite.io/console';
import QrFrame from '$lib/images/qr2.svg';
import { addNotification } from '$lib/stores/notifications';

export let showSetup = false;

Expand All @@ -28,6 +29,10 @@
await sdk.forConsole.account.updateMfaAuthenticator(AuthenticatorType.Totp, code);
await Promise.all([invalidate(Dependencies.ACCOUNT), invalidate(Dependencies.FACTORS)]);
showSetup = false;
addNotification({
type: 'success',
message: 'Authenticator app added successfully'
ItzNotABug marked this conversation as resolved.
Show resolved Hide resolved
});
trackEvent(Submit.AccountAuthenticatorUpdate);
} catch (e) {
error = e.message;
Expand Down
17 changes: 11 additions & 6 deletions src/routes/console/account/updateMfa.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,18 @@
<div
class="method u-flex u-flex-vertical-mobile u-gap-16 u-main-space-between u-sep-block-end"
style="padding-block-end: 16px">
<div class="u-flex u-gap-8">
<div class="u-flex u-gap-8 u-cross-baseline">
<div class="avatar is-size-x-small">
<span class="icon-device-mobile" aria-hidden="true" />
</div>
<div class="u-flex-vertical u-gap-4 body-text-2">
<span class="u-bold">Authenticator app</span>
<span
<div class="u-flex-vertical u-gap-4">
<div class="u-flex u-gap-4 u-cross-center">
<span class="body-text-2 u-bold">Authenticator app</span>
{#if $factors.totp}
<Pill>connected</Pill>
{/if}
</div>
<span class="body-text-2"
>Use an authentication app to generate two-factor authentication
codes.</span>
</div>
Expand All @@ -141,7 +146,7 @@
<div
class="u-flex u-main-space-between u-sep-block-end"
style="padding-block-end: 16px">
<div class="u-flex u-gap-8">
<div class="u-flex u-gap-8 u-cross-baseline">
<div class="avatar is-size-x-small">
<span class="icon-mail" aria-hidden="true" />
</div>
Expand Down Expand Up @@ -185,7 +190,7 @@
<div
class="method u-flex u-flex-vertical-mobile u-gap-16 u-main-space-between u-sep-block-end"
style="padding-block-end: 16px">
<div class="u-flex u-gap-8">
<div class="u-flex u-gap-8 u-cross-baseline">
<div class="avatar is-size-x-small">
<span class="icon-lock-open" aria-hidden="true" />
</div>
Expand Down