feat: add email verification

This commit is contained in:
Xyphyn committed 2023-09-26 16:04:21 -07:00
1 parent bfcd86e9e5
commit f50260c197
6 files changed
+122 -41

No files matched your search

+18 -1
View File
@@ -146,7 +146,24 @@ async function userFromJwt(
jwt: string,
instance: string
): Promise<{ user: PersonData; site: GetSiteResponse } | undefined> {
const site = await getClient(instance).getSite({ auth: jwt })
const sitePromise = getClient(instance).getSite({
auth: jwt,
})
let timer = setTimeout(
() =>
toast({
content: `It's taking a while to fetch your user. Is your instance down?`,
type: 'warning',
}),
5000
)
const site = await sitePromise.then((r) => {
clearTimeout(timer)
return r
})
const myUser = site.my_user
if (!myUser) return undefined