Commit d200b0dd authored by Sébastien DA ROCHA's avatar Sébastien DA ROCHA
Browse files

Fix Docker & migrate to NodeJS14

parent ab6eb33e
Pipeline #14015 passed with stage
in 58 seconds
FROM node:12.13-slim
FROM node:14-slim
# Create app directory
WORKDIR /app
......
This diff is collapsed.
import { Injectable, InternalServerErrorException, Logger } from "@nestjs/common";
import { ConfigService } from "configuration/config.service";
import { Redis } from "helpers/redis.helper";
import { ConfigService } from "../configuration/config.service";
import { Redis } from "../helpers/redis.helper";
import * as request from 'request-promise-native';
import * as jwt from 'jsonwebtoken';
import { JWTToken } from './legacy.model';
interface TokenInfos{
access_token: string;
......@@ -43,11 +43,18 @@ export class TokenService {
if (Date.now() >= token_data.exp * 1000) {
tokenInfos= await this.renewToken(email,tokenInfos);
}
return tokenInfos;
}
async getAccessToken(kongToken: JWTToken): Promise<string> {
const email = kongToken.email;
const tokenInfos = await this.getTokenInfos(email)
return tokenInfos.access_token;
}
async renewToken(email:String,tokenInfos: TokenInfos): Promise<any> {
const idpConf = this.conf.providers['OIDC'];
......@@ -81,4 +88,4 @@ export class TokenService {
}
\ No newline at end of file
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment