@propelauth/javascript
Version:
A library for managing authentication in the browser, backed by PropelAuth
41 lines (40 loc) • 1.24 kB
TypeScript
import { AccessHelper } from "./access_helper";
import { OrgIdToOrgMemberInfo } from "./org";
import { OrgHelper } from "./org_helper";
import { UserClass } from "./user";
export type User = {
userId: string;
email: string;
emailConfirmed: boolean;
hasPassword: boolean;
username?: string;
firstName?: string;
lastName?: string;
pictureUrl?: string;
locked: boolean;
enabled: boolean;
mfaEnabled: boolean;
canCreateOrgs: boolean;
createdAt: number;
lastActiveAt: number;
legacyUserId?: string;
properties?: {
[key: string]: unknown;
};
};
export type AuthenticationInfo = {
accessToken: string;
expiresAtSeconds: number;
orgHelper: OrgHelper;
accessHelper: AccessHelper;
orgIdToOrgMemberInfo?: OrgIdToOrgMemberInfo;
user: User;
userClass: UserClass;
impersonatorUserId?: string;
};
export type LogoutResponse = {
redirect_to: string;
};
export declare function fetchAuthenticationInfo(authUrl: string, activeOrgId?: string): Promise<AuthenticationInfo | null>;
export declare function logout(authUrl: string): Promise<LogoutResponse>;
export declare function parseJsonConvertingSnakeToCamel(str: string): AuthenticationInfo;