RefreshToken function
(ctx *fiber.Ctx)
| 158 | |
| 159 | // RefreshToken function |
| 160 | func (authEndpoint *AuthEndpoint) RefreshToken(ctx *fiber.Ctx) error { |
| 161 | me, err := userEndpoint.CurrentUser(ctx) |
| 162 | if err != nil { |
| 163 | return ctx.Status(401).JSON(fiber.Map{ |
| 164 | "message": err.Error(), |
| 165 | }) |
| 166 | } |
| 167 | response, err := authService.Login(me.Email, "", true) |
| 168 | if err != nil { |
| 169 | return ctx.Status(401).JSON(fiber.Map{ |
| 170 | "message": err.Error(), |
| 171 | }) |
| 172 | } |
| 173 | return ctx.JSON(response) |
| 174 | } |
nothing calls this directly
no test coverage detected