Skip to content

Commit

Permalink
fix refresh endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Wu authored and simhonchourasia committed Jul 16, 2023
1 parent 276fa43 commit 2894ab8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions backend/typescript/graphql/resolvers/authResolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,9 @@ const authResolvers = {
},
refresh: async (
_parent: undefined,
_args: Record<string, undefined>,
{ req, res }: { req: Request; res: Response },
{ refreshToken }: { refreshToken: string },
): Promise<string> => {
const token = await authService.renewToken(req.cookies.refreshToken);
res.cookie("refreshToken", token.refreshToken, cookieOptions);
const token = await authService.renewToken(refreshToken);
return token.accessToken;
},
logout: async (
Expand Down
2 changes: 1 addition & 1 deletion backend/typescript/graphql/types/authType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const authType = gql`
authId: String!
role: Role!
): Boolean!
refresh: String!
refresh(refreshToken: String!): String!
logout(userId: ID!): ID
resetPassword(email: String!): Boolean!
}
Expand Down

0 comments on commit 2894ab8

Please sign in to comment.