Add additional debug logging to InternalOAuthError case

This commit is contained in:
Tom Moor committed 2023-05-06 19:32:38 -04:00
1 parent 4b8d58afbe
commit 01855d981f
1 file changed
+5 -1
+5 -1
View File
@@ -1,5 +1,6 @@
import passport from "@outlinewiki/koa-passport";
import { Context } from "koa";
import { InternalOAuthError } from "passport-oauth2";
import env from "@server/env";
import Logger from "@server/logging/Logger";
import { AuthenticationResult } from "@server/types";
@@ -15,7 +16,10 @@ export default function createMiddleware(providerName: string) {
},
async (err, user, result: AuthenticationResult) => {
if (err) {
Logger.error("Error during authentication", err);
Logger.error(
"Error during authentication",
err instanceof InternalOAuthError ? err.oauthError : err
);
if (err.id) {
const notice = err.id.replace(/_/g, "-");