Initial production deployment setup
- Production docker-compose with nginx support - Nginx configuration for portal.monacousa.org - Deployment script with backup/restore - Gitea CI/CD workflow - Fix CountryFlag reactivity for dropdown flags Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
30
src/routes/api/auth/resend-verification/+server.ts
Normal file
30
src/routes/api/auth/resend-verification/+server.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { json } from '@sveltejs/kit';
|
||||
import type { RequestHandler } from './$types';
|
||||
|
||||
export const POST: RequestHandler = async ({ locals, url }) => {
|
||||
const { session, user } = await locals.safeGetSession();
|
||||
|
||||
if (!session || !user) {
|
||||
return json({ error: 'Not authenticated' }, { status: 401 });
|
||||
}
|
||||
|
||||
if (!user.email) {
|
||||
return json({ error: 'No email associated with account' }, { status: 400 });
|
||||
}
|
||||
|
||||
// Resend verification email
|
||||
const { error } = await locals.supabase.auth.resend({
|
||||
type: 'signup',
|
||||
email: user.email,
|
||||
options: {
|
||||
emailRedirectTo: `${url.origin}/join?verified=true`
|
||||
}
|
||||
});
|
||||
|
||||
if (error) {
|
||||
console.error('Failed to resend verification email:', error);
|
||||
return json({ error: error.message }, { status: 500 });
|
||||
}
|
||||
|
||||
return json({ success: true, message: 'Verification email sent' });
|
||||
};
|
||||
Reference in New Issue
Block a user