mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
feat(onboarding): add cookie helper, types and mock data
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
'use server';
|
||||
|
||||
import { cookies } from 'next/headers';
|
||||
|
||||
const COOKIE_NAME = 'portabase_onboarding';
|
||||
const DONE_VALUE = 'done';
|
||||
|
||||
export async function isOnboardingDone() {
|
||||
return (await cookies()).get(COOKIE_NAME)?.value === DONE_VALUE;
|
||||
}
|
||||
|
||||
export async function markOnboardingDone() {
|
||||
(await cookies()).set(COOKIE_NAME, DONE_VALUE, {
|
||||
path: '/',
|
||||
maxAge: 60 * 60 * 24 * 365,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user