add shared login pin mechansim
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { fail, redirect } from '@sveltejs/kit';
|
||||
import { createPbClient } from '$lib/server/pocketbase';
|
||||
import { setSessionCookie } from '$lib/server/session';
|
||||
import { setSessionCookie, clearActiveChild } from '$lib/server/session';
|
||||
import { pbAdmin } from '$lib/server/pocketbase';
|
||||
import { handleOf } from '@shared/slugify';
|
||||
|
||||
@@ -27,6 +27,8 @@ export const actions = {
|
||||
}
|
||||
|
||||
setSessionCookie(event.cookies, authResult.token);
|
||||
// An explicit email/password login supersedes kid mode on a shared device.
|
||||
clearActiveChild(event.cookies);
|
||||
|
||||
const fam = await pbAdmin.getOne('fams', user.famId).catch(() => null);
|
||||
const famSlug = fam?.slug || user.famId;
|
||||
|
||||
Reference in New Issue
Block a user