Skip to content

Commit cd24178

Browse files
committed
fixed typecheck errors
1 parent 43fd6bc commit cd24178

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

apps/webapp/app/services/emailAuth.server.tsx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { EmailLinkStrategy } from "remix-auth-email-link";
21
import 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";
53
import { env } from "~/env.server";
4+
import { findOrCreateUser } from "~/models/user.server";
65
import { sendMagicLinkEmail } from "~/services/email.server";
7-
import { postAuthentication } from "./postAuth.server";
6+
import type { AuthUser } from "./authUser";
87
import { logger } from "./logger.server";
9-
import { MfaRequiredError } from "./mfa/multiFactorAuthentication.server";
8+
9+
import { postAuthentication } from "./postAuth.server";
1010

1111
let secret = env.MAGIC_LINK_SECRET;
1212
if (!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
}

apps/webapp/app/services/gitHubAuth.server.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ import { GitHubStrategy } from "remix-auth-github";
33
import { env } from "~/env.server";
44
import { findOrCreateUser } from "~/models/user.server";
55
import type { AuthUser } from "./authUser";
6-
import { postAuthentication } from "./postAuth.server";
76
import { logger } from "./logger.server";
8-
import { MfaRequiredError } from "./mfa/multiFactorAuthentication.server";
7+
import { postAuthentication } from "./postAuth.server";
98

109
export 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
}

0 commit comments

Comments
 (0)