Skip to content

Commit

Permalink
added logError
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshschuler committed May 30, 2023
1 parent 1080419 commit e7540d5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/src/controllers/auth.controller.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { logError } from "@/handlers/commands/createLog.handler.ts";
import { getDiscordProfile } from "@/handlers/commands/getDiscordProfile.handler.ts";
import { LoginRequest, LoginResponse } from "@/types/login.ts";
import { hashValue } from "@/utils/auth.ts";
Expand All @@ -18,6 +19,7 @@ async function login(ctx: RouterContext<string>) {

handleResponse(ctx, createResponse<LoginResponse>({ userId: meResponse!.id }));
} else {
await logError("Unable to get discord profile", meResponse);
await ctx.state.session.deleteSession();
handleErrorResponse(ctx, "Unable to login. Please try again later.");
}
Expand Down

0 comments on commit e7540d5

Please sign in to comment.