DEV Community

Discussion on: Building NestJS app boilerplate - Authentication, Validation, GraphQL and Prisma

Collapse
 
elie222 profile image
Elie

Is this the best approach for log out?

  @Mutation(() => Boolean)
  async logOut(@ResGql() res: Response) {
    res.cookie('token', '', { httpOnly: true })
    return true
  }
Collapse
 
nikitakot profile image
Nikita Kot

Hi Elie,

This looks like as the easiest solution. Or you can implement something like token blacklist. More here.