Make orm token repo use make() to create token model instances
This commit is contained in:
parent
8a9264b9de
commit
9ede67cb12
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@extollo/lib",
|
"name": "@extollo/lib",
|
||||||
"version": "0.9.38",
|
"version": "0.9.39",
|
||||||
"description": "The framework library that lifts up your code.",
|
"description": "The framework library that lifts up your code.",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"types": "lib/index.d.ts",
|
"types": "lib/index.d.ts",
|
||||||
|
@ -5,6 +5,7 @@ import {OAuth2TokenModel} from '../models/OAuth2TokenModel'
|
|||||||
import {Config} from '../../../service/Config'
|
import {Config} from '../../../service/Config'
|
||||||
import * as jwt from 'jsonwebtoken'
|
import * as jwt from 'jsonwebtoken'
|
||||||
import {Authenticatable} from '../../types'
|
import {Authenticatable} from '../../types'
|
||||||
|
import {make} from "../../../make";
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ORMTokenRepository extends TokenRepository {
|
export class ORMTokenRepository extends TokenRepository {
|
||||||
@ -25,7 +26,7 @@ export class ORMTokenRepository extends TokenRepository {
|
|||||||
.or(60 * 60 * 6)
|
.or(60 * 60 * 6)
|
||||||
.integer() * 1000
|
.integer() * 1000
|
||||||
|
|
||||||
const token = new OAuth2TokenModel()
|
const token = make<OAuth2TokenModel>(OAuth2TokenModel)
|
||||||
token.scope = scope
|
token.scope = scope
|
||||||
token.clientId = client.id
|
token.clientId = client.id
|
||||||
token.issued = new Date()
|
token.issued = new Date()
|
||||||
|
Loading…
Reference in New Issue
Block a user