Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds committed Oct 21, 2024
1 parent eb31d37 commit 25ac7d8
Show file tree
Hide file tree
Showing 13 changed files with 2,654 additions and 2,924 deletions.
2 changes: 1 addition & 1 deletion app/routes/_auth+/auth.$provider.callback.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ test('if a user is not logged in, but the connection exists and they have enable
userId,
},
})
const { otp: _otp, ...config } = generateTOTP()
const { otp: _otp, ...config } = await generateTOTP()
await prisma.verification.create({
data: {
type: twoFAVerificationType,
Expand Down
6 changes: 3 additions & 3 deletions app/routes/_auth+/verify.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ export async function prepareVerification({
const verifyUrl = getRedirectToUrl({ request, type, target })
const redirectTo = new URL(verifyUrl.toString())

const { otp, ...verificationConfig } = generateTOTP({
algorithm: 'SHA256',
const { otp, ...verificationConfig } = await generateTOTP({
algorithm: 'SHA-256',
// Leaving off 0, O, and I on purpose to avoid confusing users.
charSet: 'ABCDEFGHJKLMNPQRSTUVWXYZ123456789',
period,
Expand Down Expand Up @@ -128,7 +128,7 @@ export async function isCodeValid({
select: { algorithm: true, secret: true, period: true, charSet: true },
})
if (!verification) return false
const result = verifyTOTP({
const result = await verifyTOTP({
otp: code,
...verification,
})
Expand Down
2 changes: 1 addition & 1 deletion app/routes/settings+/profile.two-factor.index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export async function loader({ request }: LoaderFunctionArgs) {

export async function action({ request }: ActionFunctionArgs) {
const userId = await requireUserId(request)
const { otp: _otp, ...config } = generateTOTP()
const { otp: _otp, ...config } = await generateTOTP()
const verificationData = {
...config,
type: twoFAVerifyVerificationType,
Expand Down
2 changes: 2 additions & 0 deletions app/routes/settings+/profile.two-factor.verify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ export async function loader({ request }: LoaderFunctionArgs) {
const issuer = new URL(getDomainUrl(request)).host
const otpUri = getTOTPAuthUri({
...verification,
// OTP clients break with the `-` in the algorithm name.
algorithm: verification.algorithm.replaceAll('-', ''),
accountName: user.email,
issuer,
})
Expand Down
2 changes: 1 addition & 1 deletion app/utils/providers/github.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class GitHubProvider implements AuthProvider {
throw new Error('Email not found')
}
const username = profile.displayName
const imageUrl = profile.photos[0].value
const imageUrl = profile.photos[0]?.value
return {
email,
id: profile.id,
Expand Down
4 changes: 4 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ import { default as defaultConfig } from '@epic-web/config/eslint'
export default [
...defaultConfig,
// add custom config objects here:
{
files: ['**/tests/**/*.ts'],
rules: { 'react-hooks/rules-of-hooks': 'off' },
},
]
2 changes: 0 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import 'dotenv/config'
import * as fs from 'node:fs'
import chalk from 'chalk'
import closeWithGrace from 'close-with-grace'
import sourceMapSupport from 'source-map-support'

sourceMapSupport.install({
Expand Down
Loading

0 comments on commit 25ac7d8

Please sign in to comment.