File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ export class AuthController {
3636 // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call
3737 return passport . authenticate (
3838 'steam' ,
39- ( error : Error , player : Player ) => {
39+ ( error : unknown , player : Player ) => {
4040 let url = this . environment . clientUrl ;
4141 if ( req . headers . cookie ) {
4242 const cookies = parse ( req . headers . cookie ) ;
@@ -49,7 +49,14 @@ export class AuthController {
4949 }
5050
5151 if ( error ) {
52- this . logger . warn ( `Login error: ${ error . message } ` ) ;
52+ if ( error instanceof Error ) {
53+ this . logger . warn ( `Login error: ${ error . message } ` ) ;
54+ } else if ( typeof error === 'string' ) {
55+ this . logger . warn ( `Login error: ${ error } ` ) ;
56+ } else {
57+ this . logger . warn ( `Login error: ${ JSON . stringify ( error ) } ` ) ;
58+ }
59+
5360 const clientErrorCode = this . mapToClientError ( error ) ;
5461 return res . redirect ( `${ url } /auth-error?error=${ clientErrorCode } ` ) ;
5562 }
You can’t perform that action at this time.
0 commit comments