UNPKG

@brewww/authentication-service

Version:
22 lines (21 loc) 1.05 kB
import { CustomClaim } from "./concrete/custom-claim.type"; import { ICustomClaimsImporter } from "./interfaces/custom-claims-importer.interface"; import { Repository } from "typeorm"; import { RefreshToken, User } from "../entities"; import { Tokens } from "../dto"; import { ConfigService } from "@nestjs/config"; export declare class TokenService { private readonly refreshTokenRepository; private readonly configService; private customClaimImporters; constructor(refreshTokenRepository: Repository<RefreshToken>, configService: ConfigService); private createIdTokenAsync; private createRefreshTokenAsync; createTokensAsync(user: User, expiresIn?: number | string): Promise<Tokens>; addCustomClaimImporter(customClaimImporter: ICustomClaimsImporter): void; private applyCustomClaimImportersAsync; transformClaimsToObject(claims: CustomClaim[]): Record<string, any>; refreshTokensAsync(refreshToken: string): Promise<Tokens>; private getValidRefreshTokenAsync; private terminateRefreshTokenAsync; }