File tree Expand file tree Collapse file tree 2 files changed +7
-18
lines changed Expand file tree Collapse file tree 2 files changed +7
-18
lines changed Original file line number Diff line number Diff line change 1- import { EmailLinkStrategy } from "remix-auth-email-link" ;
21import type { Authenticator } from "remix-auth" ;
3- import type { AuthUser } from "./authUser" ;
4- import { findOrCreateUser } from "~/models/user.server" ;
2+ import { EmailLinkStrategy } from "remix-auth-email-link" ;
53import { env } from "~/env.server" ;
4+ import { findOrCreateUser } from "~/models/user.server" ;
65import { sendMagicLinkEmail } from "~/services/email.server" ;
7- import { postAuthentication } from "./postAuth.server " ;
6+ import type { AuthUser } from "./authUser " ;
87import { logger } from "./logger.server" ;
9- import { MfaRequiredError } from "./mfa/multiFactorAuthentication.server" ;
8+
9+ import { postAuthentication } from "./postAuth.server" ;
1010
1111let secret = env . MAGIC_LINK_SECRET ;
1212if ( ! secret ) throw new Error ( "Missing MAGIC_LINK_SECRET env variable." ) ;
@@ -39,11 +39,6 @@ const emailStrategy = new EmailLinkStrategy(
3939
4040 return { userId : user . id } ;
4141 } catch ( error ) {
42- // Skip logging the error if it's a MfaRequiredError
43- if ( error instanceof MfaRequiredError ) {
44- throw error ;
45- }
46-
4742 logger . debug ( "Magic link user failed to authenticate" , { error : JSON . stringify ( error ) } ) ;
4843 throw error ;
4944 }
Original file line number Diff line number Diff line change @@ -3,9 +3,8 @@ import { GitHubStrategy } from "remix-auth-github";
33import { env } from "~/env.server" ;
44import { findOrCreateUser } from "~/models/user.server" ;
55import type { AuthUser } from "./authUser" ;
6- import { postAuthentication } from "./postAuth.server" ;
76import { logger } from "./logger.server" ;
8- import { MfaRequiredError } from "./mfa/multiFactorAuthentication .server" ;
7+ import { postAuthentication } from "./postAuth .server" ;
98
109export function addGitHubStrategy (
1110 authenticator : Authenticator < AuthUser > ,
@@ -45,12 +44,7 @@ export function addGitHubStrategy(
4544 userId : user . id ,
4645 } ;
4746 } catch ( error ) {
48- // Skip logging the error if it's a MfaRequiredError
49- if ( error instanceof MfaRequiredError ) {
50- throw error ;
51- }
52-
53- console . error ( error ) ;
47+ logger . error ( "GitHub login failed" , { error : JSON . stringify ( error ) } ) ;
5448 throw error ;
5549 }
5650 }
You can’t perform that action at this time.
0 commit comments