mirror of
https://github.com/lukevella/rallly.git
synced 2025-08-06 09:59:00 +02:00
⬆️ v3.0.0 (#704)
This commit is contained in:
parent
735056f25f
commit
c22b3abc4d
385 changed files with 19912 additions and 5250 deletions
|
@ -1,8 +1,17 @@
|
|||
import { TimeFormat } from "@rallly/database";
|
||||
import { sealData, unsealData } from "iron-session";
|
||||
|
||||
import { sessionConfig } from "./session-config";
|
||||
|
||||
type UserSessionData = { id: string; isGuest: boolean };
|
||||
type UserSessionData = {
|
||||
id: string;
|
||||
isGuest: boolean;
|
||||
preferences?: {
|
||||
timeZone?: string;
|
||||
weekStart?: number;
|
||||
timeFormat?: TimeFormat;
|
||||
};
|
||||
};
|
||||
|
||||
declare module "iron-session" {
|
||||
export interface IronSessionData {
|
||||
|
@ -16,6 +25,7 @@ export const decryptToken = async <P extends Record<string, unknown>>(
|
|||
const payload = await unsealData(token, {
|
||||
password: sessionConfig.password,
|
||||
});
|
||||
|
||||
if (Object.keys(payload).length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue