mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
feat(mfa): add back button on verify identity page
Provide a way for a user to go back/cancel so that they can clear their session. Otherwise, they would need to dig into their browser settings to delete the cookie and/or fallback header. This only adds the button on desktop because the button doesn't fit right on mobile.
This commit is contained in:
2 files changed
+44
-1
No files matched your search
@@ -38,7 +38,8 @@
|
||||
<p>Build like a team of hundreds<span class="underscore">_</span></p>
|
||||
</div>
|
||||
</section>
|
||||
<section class="grid-1-1-col-2 u-flex u-main-center u-cross-center">
|
||||
<section class="grid-1-1-col-2 u-flex">
|
||||
<slot name="top" />
|
||||
<div class="container u-flex u-flex-vertical u-cross-center u-main-center">
|
||||
<div class="u-max-width-500 u-width-full-line">
|
||||
<h1 class="heading-level-2 u-margin-block-start-auto">
|
||||
|
||||
@@ -39,6 +39,11 @@
|
||||
}
|
||||
});
|
||||
|
||||
async function back() {
|
||||
await sdk.forConsole.account.deleteSession('current');
|
||||
await goto(`${base}/`);
|
||||
}
|
||||
|
||||
async function verify() {
|
||||
try {
|
||||
disabled = true;
|
||||
@@ -75,6 +80,15 @@
|
||||
</svelte:head>
|
||||
|
||||
<Unauthenticated>
|
||||
<svelte:fragment slot="top">
|
||||
<div class="top u-flex u-position-absolute u-main-center">
|
||||
<div class="flex u-width-full-line">
|
||||
<Button text noMargin class="u-border-width-0" on:click={back}>
|
||||
<span class="icon-cheveron-left u-font-size-20" aria-hidden="true" />
|
||||
Back</Button>
|
||||
</div>
|
||||
</div>
|
||||
</svelte:fragment>
|
||||
<svelte:fragment slot="title">Verify your identity</svelte:fragment>
|
||||
<svelte:fragment>
|
||||
<Form onSubmit={verify}>
|
||||
@@ -163,3 +177,31 @@
|
||||
</Form>
|
||||
</svelte:fragment>
|
||||
</Unauthenticated>
|
||||
|
||||
<style lang="scss">
|
||||
@import '@appwrite.io/pink/src/abstract/variables/_devices.scss';
|
||||
.top {
|
||||
inset-block-start: 5.85rem;
|
||||
inline-size: 100%;
|
||||
max-inline-size: 27.5rem;
|
||||
|
||||
div {
|
||||
max-inline-size: 27.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 440px) {
|
||||
.top {
|
||||
inset-block-start: 0rem;
|
||||
padding-inline: 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* for smaller screens */
|
||||
@media #{$break2open} {
|
||||
.top {
|
||||
inset-block-start: 5.85rem;
|
||||
padding-inline: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user