mirror of
https://github.com/ershisan99/flashcards-api.git
synced 2025-12-16 20:59:26 +00:00
feat: return generated tokens on refresh
This commit is contained in:
@@ -76,10 +76,10 @@ export class AuthController {
|
||||
@ApiOperation({ description: 'Update current user data.', summary: 'Update user data' })
|
||||
@ApiUnauthorizedResponse({ description: 'Not logged in' })
|
||||
@ApiBadRequestResponse({ description: 'User not found' })
|
||||
@ApiBearerAuth()
|
||||
@UseInterceptors(FileFieldsInterceptor([{ name: 'avatar', maxCount: 1 }]))
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Patch('me')
|
||||
@ApiBearerAuth()
|
||||
async updateUserData(
|
||||
@Request() req,
|
||||
@UploadedFiles()
|
||||
@@ -210,8 +210,15 @@ export class AuthController {
|
||||
sameSite: 'none',
|
||||
secure: true,
|
||||
})
|
||||
res.send({
|
||||
accessToken: newTokens.accessToken,
|
||||
refreshToken: newTokens.refreshToken,
|
||||
})
|
||||
|
||||
return { accessToken: newTokens.accessToken, refreshToken: newTokens.refreshToken }
|
||||
return {
|
||||
accessToken: newTokens.accessToken,
|
||||
refreshToken: newTokens.refreshToken,
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation({
|
||||
|
||||
@@ -44,7 +44,6 @@ import {
|
||||
PaginatedDecksWithMaxCardsCount,
|
||||
} from './entities/deck.entity'
|
||||
import { MinMaxCards } from './entities/min-max-cards.entity'
|
||||
import { DecksRepository } from './infrastructure/decks.repository'
|
||||
import {
|
||||
CreateCardCommand,
|
||||
CreateDeckCommand,
|
||||
|
||||
Reference in New Issue
Block a user