login-with-huma-node
Version:
A Node.js package for huma auth server endpoints for third party clients to help authenticate users with their huma account
39 lines (30 loc) • 1.05 kB
TypeScript
declare module "login-with-huma-node" {
export interface User {
email?: string;
phone?: string;
city?: string;
[key: string]: any;
}
export interface ExchangeCodeResult {
info?: User;
user?: User;
accessToken: string;
accessTokenExpireTime: string;
refreshToken: string;
refreshTokenExpireTime: string;
}
export default class server {
constructor(options: {
clientSecret?: string | null;
clientId?: string | null,
accessToken?: string | null,
accessTokenExpireTime?: string | null,
refreshToken?: string | null,
refreshTokenExpireTime?: string | null,
})
exchangeTemporaryCode(accessToken?: string): Promise<ExchangeCodeResult>;
userInfo(): User | null;
getUserData(accessToken?: string): Promise<User>;
hasUserLoggedOut(phone: string, macAddress: string): Promise<boolean>;
}
}