Skip to content

Commit 25ac7d8

Browse files
committed
update dependencies
1 parent eb31d37 commit 25ac7d8

File tree

13 files changed

+2654
-2924
lines changed

13 files changed

+2654
-2924
lines changed

app/routes/_auth+/auth.$provider.callback.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ test('if a user is not logged in, but the connection exists and they have enable
193193
userId,
194194
},
195195
})
196-
const { otp: _otp, ...config } = generateTOTP()
196+
const { otp: _otp, ...config } = await generateTOTP()
197197
await prisma.verification.create({
198198
data: {
199199
type: twoFAVerificationType,

app/routes/_auth+/verify.server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ export async function prepareVerification({
8787
const verifyUrl = getRedirectToUrl({ request, type, target })
8888
const redirectTo = new URL(verifyUrl.toString())
8989

90-
const { otp, ...verificationConfig } = generateTOTP({
91-
algorithm: 'SHA256',
90+
const { otp, ...verificationConfig } = await generateTOTP({
91+
algorithm: 'SHA-256',
9292
// Leaving off 0, O, and I on purpose to avoid confusing users.
9393
charSet: 'ABCDEFGHJKLMNPQRSTUVWXYZ123456789',
9494
period,
@@ -128,7 +128,7 @@ export async function isCodeValid({
128128
select: { algorithm: true, secret: true, period: true, charSet: true },
129129
})
130130
if (!verification) return false
131-
const result = verifyTOTP({
131+
const result = await verifyTOTP({
132132
otp: code,
133133
...verification,
134134
})

app/routes/settings+/profile.two-factor.index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export async function loader({ request }: LoaderFunctionArgs) {
2929

3030
export async function action({ request }: ActionFunctionArgs) {
3131
const userId = await requireUserId(request)
32-
const { otp: _otp, ...config } = generateTOTP()
32+
const { otp: _otp, ...config } = await generateTOTP()
3333
const verificationData = {
3434
...config,
3535
type: twoFAVerifyVerificationType,

app/routes/settings+/profile.two-factor.verify.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ export async function loader({ request }: LoaderFunctionArgs) {
6969
const issuer = new URL(getDomainUrl(request)).host
7070
const otpUri = getTOTPAuthUri({
7171
...verification,
72+
// OTP clients break with the `-` in the algorithm name.
73+
algorithm: verification.algorithm.replaceAll('-', ''),
7274
accountName: user.email,
7375
issuer,
7476
})

app/utils/providers/github.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class GitHubProvider implements AuthProvider {
3838
throw new Error('Email not found')
3939
}
4040
const username = profile.displayName
41-
const imageUrl = profile.photos[0].value
41+
const imageUrl = profile.photos[0]?.value
4242
return {
4343
email,
4444
id: profile.id,

eslint.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@ import { default as defaultConfig } from '@epic-web/config/eslint'
44
export default [
55
...defaultConfig,
66
// add custom config objects here:
7+
{
8+
files: ['**/tests/**/*.ts'],
9+
rules: { 'react-hooks/rules-of-hooks': 'off' },
10+
},
711
]

index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import 'dotenv/config'
22
import * as fs from 'node:fs'
3-
import chalk from 'chalk'
4-
import closeWithGrace from 'close-with-grace'
53
import sourceMapSupport from 'source-map-support'
64

75
sourceMapSupport.install({

0 commit comments

Comments
 (0)