feat: encapsulate identity with better-auth
This commit is contained in:
50
modules/identity/types.ts
Normal file
50
modules/identity/types.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import "@platform/relay";
|
||||
import "@platform/storage";
|
||||
|
||||
import type { Session } from "better-auth";
|
||||
|
||||
import type { AccessControlMethods } from "./access.ts";
|
||||
import type { Principal } from "./principal.ts";
|
||||
|
||||
declare module "@platform/storage" {
|
||||
interface StorageContext {
|
||||
/**
|
||||
* TODO ...
|
||||
*/
|
||||
session?: Session;
|
||||
|
||||
/**
|
||||
* TODO ...
|
||||
*/
|
||||
principal?: Principal;
|
||||
|
||||
/**
|
||||
* TODO ...
|
||||
*/
|
||||
access?: AccessControlMethods;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "@platform/relay" {
|
||||
interface ServerContext {
|
||||
/**
|
||||
* TODO ...
|
||||
*/
|
||||
isAuthenticated: boolean;
|
||||
|
||||
/**
|
||||
* TODO ...
|
||||
*/
|
||||
session: Session;
|
||||
|
||||
/**
|
||||
* TODO ...
|
||||
*/
|
||||
principal: Principal;
|
||||
|
||||
/**
|
||||
* TODO ...
|
||||
*/
|
||||
access: AccessControlMethods;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user