import { CustomWindow } from "./custom/custom.window"; export interface Campus { code: string; name: string; uri: string; } export interface AuthUser { id: string; email: string; firstName: string; lastName: string; campus: Campus; rss: boolean; } declare const window: CustomWindow; export const DefaultLocationUtils = { assign: (url: string) => window.location.assign(url), get href() { return window.location.href; }, }; export class BrowserSecurityHelper { static get authUser(): AuthUser { const browserSecurity = new window.BrowserSecurity( DefaultLocationUtils, "/auth" ); if (!browserSecurity.isAuthenticated) { browserSecurity.login(); } return browserSecurity.user; } }