refresh-tokens
Version:
refresh tokens library for nodejs server with mongodb
19 lines (18 loc) • 567 B
TypeScript
interface RefreshTokenData {
token: string;
expiresIn: number;
}
declare class Tokens {
expiresIn: number;
jwtSecret: string;
constructor(jwtSecret: string, expiresIn: number);
refresh(token: string): Promise<RefreshTokenData>;
register(input: {
userId?: string;
token: string;
pushNotificationToken?: string;
}): Promise<void>;
setPushNotificationToken(token: string, pushNotificationToken: string): Promise<void>;
getPushNotificationTokens(userId: string): Promise<string[]>;
}
export default Tokens;