-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improve verification handling between independent windows
Should fix #298. Mitigates #297 somewhat, in the sense that this adds proactive one-time checks/state reloads when the user tries to access a resource that is verification-depedent client-side. No verification state streaming yet (only possible via Firestore), but this should already reduce the UX friction that exists today when verifying on a different device/window, especially in combination with the ReloadSuggestion component.
- Loading branch information
Showing
12 changed files
with
140 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<script> | ||
import { _ } from 'svelte-i18n'; | ||
import { auth } from '../api/firebase'; | ||
// Migitates https://github.com/WelcometoMyGarden/welcometomygarden/issues/297 | ||
// NOTE: Might perform an unnecessary double reload when being redirected by | ||
// checkAndHandleUnverified | ||
auth().currentUser?.reload(); | ||
</script> | ||
<p class="reload-suggestion"> | ||
{@html $_('account.verify.reload-suggestion', { | ||
values: { | ||
reloading: `<a onclick="window.location.reload()">${$_('account.verify.reloading-text')}</a>` | ||
} | ||
})} | ||
</p> | ||
<style> | ||
.reload-suggestion { | ||
margin-top: 1rem; | ||
font-style: italic; | ||
} | ||
.reload-suggestion :global(a), | ||
.reload-suggestion :global(a:link), | ||
.reload-suggestion :global(a:visited), | ||
.reload-suggestion :global(a:active) { | ||
cursor: pointer; | ||
color: var(--color-orange); | ||
text-decoration: underline; | ||
} | ||
.reload-suggestion :global(a:hover) { | ||
text-decoration: none; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.