mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-06-17 01:59:08 +00:00
port full auth flow to cf workers
This commit is contained in:
parent
9eeb946389
commit
aad0987dce
50 changed files with 551 additions and 1167 deletions
|
@ -34,3 +34,16 @@ export type PresentableGuild = {
|
|||
export type GuildEnumeration = {
|
||||
guildsList: PresentableGuild[];
|
||||
};
|
||||
|
||||
export enum UserGuildPermissions {
|
||||
User,
|
||||
Manager,
|
||||
Admin,
|
||||
}
|
||||
|
||||
export type GuildSlug = {
|
||||
id: string;
|
||||
name: string;
|
||||
icon: string;
|
||||
permissionLevel: UserGuildPermissions;
|
||||
};
|
||||
|
|
18
src/common/types/Session.ts
Normal file
18
src/common/types/Session.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { GuildSlug } from './Guild';
|
||||
import { DiscordUser } from './User';
|
||||
|
||||
export type AuthTokenResponse = {
|
||||
access_token: string;
|
||||
token_type: 'Bearer';
|
||||
expires_in: number;
|
||||
refresh_token: string;
|
||||
scope: string;
|
||||
};
|
||||
|
||||
export type SessionData = {
|
||||
/** sessionID is a KSUID */
|
||||
sessionID: string;
|
||||
tokens: AuthTokenResponse;
|
||||
user: DiscordUser;
|
||||
guilds: GuildSlug[];
|
||||
};
|
|
@ -2,3 +2,4 @@ export * from './Role';
|
|||
export * from './Category';
|
||||
export * from './Guild';
|
||||
export * from './User';
|
||||
export * from './Session';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue