UNPKG

@nxtoai/jwtette

Version:

JWT authentication package for NxtoAI microservices

23 lines (22 loc) 934 B
import { ConfigService } from '@nestjs/config'; import { JwtService } from '@nestjs/jwt'; import { GatiService } from '@nxtoai/gati'; import { AagService } from '@nxtoai/aag'; export declare class JwtHelper { private readonly configService; private readonly jwtService; private readonly gati; private readonly aag; private readonly TOKEN_PREFIX; private readonly USER_PREFIX; private readonly TOKEN_EXPIRY; constructor(configService: ConfigService, jwtService: JwtService, gati: GatiService, aag: AagService); private getTokenKey; private getUserKey; cacheToken(token: string, userid: string): Promise<void>; getTokenUser(token: string): Promise<string | null>; getUserToken(userid: string): Promise<string | null>; invalidateToken(token: string): Promise<void>; invalidateUserToken(userid: string): Promise<void>; isTokenBlacklisted(token: string): Promise<boolean>; }