Commit ab6eb33e authored by DESPRES Damien's avatar DESPRES Damien
Browse files

get token from redis

parent a5190988
Pipeline #13972 passed with stage
in 4 seconds
import {
Controller, Post, Body, HttpException, InternalServerErrorException,
HttpCode, Get, Req, Delete, Put, Query,
HttpCode, Get, Req, Delete, Put, Query, Res, HttpStatus, Param,
} from '@nestjs/common';
import { LegacyService } from './legacy.service';
import { LegacyServiceOIDC } from './legacy.service.oidc';
......@@ -11,6 +11,7 @@ import {
AccessRequestResponse, AccessRenewalResponse, UserAccountValidationRequest, PasswordResetForm, PasswordForgottenForm,
} from './legacy.model';
import { handleError } from './errorHandlingHelper';
import { TokenService } from './token.service';
@ApiUseTags('legacy')
@Controller()
......@@ -19,8 +20,14 @@ export class LegacyController {
constructor(
private legacyService: LegacyService,
private legacyServiceOidc: LegacyServiceOIDC,
private tokenService: TokenService,
) { }
@Get('user')
@ApiOperation({ title: 'Get user info.' })
@ApiImplicitHeader({
......@@ -96,7 +103,7 @@ export class LegacyController {
@HttpCode(201)
async createOidcAccount(@Req() req) {
try {
return await this.legacyServiceOidc.createAccount(req.headers['apis_access_token']);
return await this.legacyServiceOidc.createAccount(req.headers['email']);
} catch (error) {
if (error instanceof HttpException) {
throw error;
......
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