mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-02 03:38:22 +00:00
refactor: update authentication flow to use NextAuth, replace better-auth with axios for API calls, and clean up unused code
This commit is contained in:
38
lib/types/user.ts
Normal file
38
lib/types/user.ts
Normal file
@ -0,0 +1,38 @@
|
||||
import type { ISODateString } from "next-auth";
|
||||
|
||||
export interface Permission {
|
||||
id: number;
|
||||
name: string;
|
||||
user: User;
|
||||
}
|
||||
|
||||
export interface TAuthUser {
|
||||
expiry?: string;
|
||||
token?: string;
|
||||
user: User;
|
||||
}
|
||||
|
||||
export interface User {
|
||||
id: number;
|
||||
username: string;
|
||||
email: string;
|
||||
user_permissions: Permission[];
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
is_superuser: boolean;
|
||||
date_joined: string;
|
||||
last_login: string;
|
||||
}
|
||||
|
||||
export interface Session {
|
||||
user?: {
|
||||
token?: string;
|
||||
name?: string | null;
|
||||
email?: string | null;
|
||||
image?: string | null;
|
||||
user?: User & {
|
||||
expiry?: string;
|
||||
};
|
||||
};
|
||||
expires: ISODateString;
|
||||
}
|
Reference in New Issue
Block a user