diff --git a/api/src/auth/dto/auth.jwt.dto.ts b/api/src/auth/dto/auth.jwt.dto.ts index bccf87ab..e10c4f36 100644 --- a/api/src/auth/dto/auth.jwt.dto.ts +++ b/api/src/auth/dto/auth.jwt.dto.ts @@ -2,9 +2,8 @@ import { ApiModelProperty } from '@nestjs/swagger'; export class AuthJwtDto { @ApiModelProperty() - token: { - accessToken: string; + accessToken: string; - refreshToken: string; - } + @ApiModelProperty() + refreshToken: string; } diff --git a/api/src/auth/services/auth.service.ts b/api/src/auth/services/auth.service.ts index dc26649d..518b5419 100644 --- a/api/src/auth/services/auth.service.ts +++ b/api/src/auth/services/auth.service.ts @@ -54,19 +54,17 @@ export class AuthService { scope: user.roles, }; return { - token: { - accessToken: this.jwtService.sign(payload), - // TODO add refresh token invalidation uppon usage! They should only work once - refreshToken: this.jwtService.sign( - { - ...payload, - refresh: true - }, - { - expiresIn: '30days', - } - ), - } + accessToken: this.jwtService.sign(payload), + // TODO add refresh token invalidation uppon usage! They should only work once + refreshToken: this.jwtService.sign( + { + ...payload, + refresh: true + }, + { + expiresIn: '30days', + } + ), }; } } diff --git a/ui/nuxt.config.js b/ui/nuxt.config.js index 494f9882..10460e84 100644 --- a/ui/nuxt.config.js +++ b/ui/nuxt.config.js @@ -32,7 +32,7 @@ export default { strategies: { local: { endpoints: { - login: { url: '/api/auth/login', method: 'post', propertyName: 'token.accessToken' }, + login: { url: '/api/auth/login', method: 'post', propertyName: 'accessToken' }, logout: { url: '/api/auth/logout', method: 'post' }, user: false },