UNPKG

lbx-jwt

Version:

Provides JWT authentication for loopback applications. Includes storing roles inside tokens and handling refreshing. Built-in reuse detection.

40 lines (39 loc) 1.03 kB
import { Entity } from '@loopback/repository'; /** * The credentials of an user. * They are stored separately so its less likely there are sent to the frontend by accident. */ export declare class Credentials extends Entity { /** * The id of the credentials. */ id: string; /** * The password of the user. * Is stored as a hashed string. */ password: string; /** * The two factor authentication secret. * Unique for each user and is needed to validate two factor codes. */ twoFactorSecret?: string; /** * The two factor url that is needed to display a qr code. */ twoFactorAuthUrl?: string; /** * The user that this credentials belong to. */ baseUserId: string; constructor(data?: Partial<Credentials>); } /** * Properties of the entity relations. */ export interface CredentialsRelations { } /** * The entity with its relation properties. */ export type CredentialsWithRelations = Credentials & CredentialsRelations;