Compare commits
3 Commits
db703df2cb
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
85ed6cccd4 | ||
|
|
c275367d86 | ||
|
|
46b0a79a19 |
@@ -1 +1,7 @@
|
|||||||
export const PASSPORT_OPTIONS = Symbol('PassportOptions')
|
export const PASSPORT_OPTIONS = Symbol('PassportOptions')
|
||||||
|
|
||||||
|
export const TOKEN_TYPES = {
|
||||||
|
AUTH: 'PassportToken/v1',
|
||||||
|
REFRESH: 'PassportToken/v1/refresh',
|
||||||
|
TEMP_2FA: 'PassportToken/v1/2fa'
|
||||||
|
} as const
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
export * from './interfaces'
|
export * from './interfaces'
|
||||||
export * from './passport.module'
|
export * from './passport.module'
|
||||||
export * from './passport.service'
|
export * from './passport.service'
|
||||||
|
export * from './constants'
|
||||||
|
|||||||
@@ -1,15 +1,10 @@
|
|||||||
import { Inject, Injectable } from '@nestjs/common'
|
import { Inject, Injectable } from '@nestjs/common'
|
||||||
import { createHmac, randomUUID } from 'crypto'
|
import { createHmac, randomUUID } from 'crypto'
|
||||||
|
|
||||||
import { PASSPORT_OPTIONS } from './constants'
|
import { PASSPORT_OPTIONS, TOKEN_TYPES } from './constants'
|
||||||
import { PassportOptions } from './interfaces'
|
import { PassportOptions } from './interfaces'
|
||||||
import { base64UrlDecode, base64UrlEncode, constantTimeEqual } from './utils'
|
import { base64UrlDecode, base64UrlEncode, constantTimeEqual } from './utils'
|
||||||
|
|
||||||
const TOKEN_TYPES = {
|
|
||||||
AUTH: 'PassportToken/v1',
|
|
||||||
TEMP_2FA: 'PassportToken/v1/2fa'
|
|
||||||
} as const
|
|
||||||
|
|
||||||
type TokenType = (typeof TOKEN_TYPES)[keyof typeof TOKEN_TYPES]
|
type TokenType = (typeof TOKEN_TYPES)[keyof typeof TOKEN_TYPES]
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@lendry-erp/passport",
|
"name": "@lendry-erp/passport",
|
||||||
"version": "1.0.1",
|
"version": "1.0.3",
|
||||||
"description": "Библиотека для аутентификации.",
|
"description": "Библиотека для аутентификации.",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
|
|||||||
Reference in New Issue
Block a user