Add additional debug logging to InternalOAuthError case
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import passport from "@outlinewiki/koa-passport";
|
import passport from "@outlinewiki/koa-passport";
|
||||||
import { Context } from "koa";
|
import { Context } from "koa";
|
||||||
|
import { InternalOAuthError } from "passport-oauth2";
|
||||||
import env from "@server/env";
|
import env from "@server/env";
|
||||||
import { AuthenticationError } from "@server/errors";
|
import { AuthenticationError } from "@server/errors";
|
||||||
import Logger from "@server/logging/Logger";
|
import Logger from "@server/logging/Logger";
|
||||||
@@ -16,7 +17,10 @@ export default function createMiddleware(providerName: string) {
|
|||||||
},
|
},
|
||||||
async (err, user, result: AuthenticationResult) => {
|
async (err, user, result: AuthenticationResult) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
Logger.error("Error during authentication", err);
|
Logger.error(
|
||||||
|
"Error during authentication",
|
||||||
|
err instanceof InternalOAuthError ? err.oauthError : err
|
||||||
|
);
|
||||||
|
|
||||||
if (err.id) {
|
if (err.id) {
|
||||||
const notice = err.id.replace(/_/g, "-");
|
const notice = err.id.replace(/_/g, "-");
|
||||||
|
|||||||
Reference in New Issue
Block a user