misc: add message when signing up for registration apps

This commit is contained in:
Xyphyn committed 2023-10-14 11:35:24 -07:00
1 parent 108169f5a9
commit 9d8b143964
3 files changed
+28 -14

No files matched your search

+1 -1
View File
@@ -6,7 +6,7 @@
import { Badge } from 'mono-svelte'
</script>
{#if $profile?.user?.notifications.applications ?? 0 > 0}
{#if ($profile?.user?.notifications.applications ?? 0) > 0}
<span class="flex flex-row text-red-500 gap-2">
<Badge color="red-subtle" class="w-max">
{$profile?.user?.notifications.applications}
+25 -11
View File
@@ -64,27 +64,41 @@
honeypot,
})
toast({
content: 'Signed up.',
type: 'success',
})
if (res?.jwt) {
await setUser(res.jwt, $page.params.instance, username)
toast({ content: 'Successfully logged in.', type: 'success' })
goto('/')
} else if (res.verify_email_sent) {
} else if (
res.verify_email_sent ||
data.site_view.local_site.registration_mode == 'RequireApplication'
) {
currentInstance.set(instance)
toast({
content:
'A verification link was sent to your email. Verify your email, and then you can log in.',
type: 'info',
})
if (res.verify_email_sent) {
toast({
content:
'A verification link was sent to your email. Verify your email, and then you can log in.',
type: 'info',
})
}
if (
data.site_view.local_site.registration_mode == 'RequireApplication'
) {
toast({
content:
'Please wait for your registration application to be approved before you can log in.',
type: 'info',
})
}
goto('/')
} else {
throw new Error('Failed to sign up.')
}
toast({
content: 'Signed up.',
type: 'success',
})
} catch (err) {
toast({
content: err as any,