Add Mode1 auth testing environment with token comparison verification

- Created Mode1 as self-contained test environment
- Added auth-module copy with self-contained configuration
- Implemented backend server with Graph token and PocketBase validation endpoints
- Added frontend test dashboard with token comparison functionality
- Fixed TypeScript compatibility issues (replaced import.meta.dir with __dirname)
- Implemented actual PB token validation in comparison endpoint (no placeholders)
- All endpoints tested and working with real tokens
This commit is contained in:
2026-01-22 05:32:33 +00:00
parent 3ff23cd2bd
commit 1fdc87f7f4
152 changed files with 2672 additions and 21067 deletions
+62
View File
@@ -0,0 +1,62 @@
/**
* Frontend Auth Configuration
*/
export interface AuthConfig {
pbUrl: string; // PocketBase URL (required)
collection?: string;
provider?: string;
loginContainerId?: string;
userDisplayNameId?: string;
userEmailId?: string;
loginBtnId?: string;
loginErrorId?: string;
}
/**
* Frontend configuration provided by backend
*/
export interface FrontendConfig {
pbUrl: string;
provider?: string;
collection?: string;
}
/**
* Backend Auth Configuration
*/
export interface BackendAuthConfig {
clientId?: string;
tenantId?: string;
clientSecret?: string;
}
/**
* Auth state object
*/
export interface AuthState {
isAuthenticated: boolean;
user: {
id: string;
name: string;
email: string;
} | null;
token: string | null;
}
/**
* Graph token cache object
*/
export interface GraphTokenCache {
token: string;
expiresOn: number;
}
/**
* Auth event callbacks
*/
export interface AuthCallbacks {
onAuthSuccess?: (state: AuthState) => void;
onAuthFailure?: (error: any) => void;
onTokenUpdate?: (state: AuthState) => void;
onUiUpdate?: (state: AuthState) => void;
}