Skip to content

Commit

Permalink
fix(routes): use nodejs runtime for auth pages
Browse files Browse the repository at this point in the history
We need to use `crypto` to hash and check validity of passwords. Simply
setting the runtime back to Node.js seemed like an easier fix than
debugging why we weren't using Vercel's `crypto` edge runtime.
  • Loading branch information
nicholaschiang committed Jul 23, 2023
1 parent 9d94e20 commit aff66f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/routes/_layout.join.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export const handle: Handle = {
breadcrumb: () => <Link to='/join'>sign up</Link>,
}

export const config = { runtime: 'nodejs' }

export async function loader({ request }: LoaderArgs) {
const userId = await getUserId(request)
if (userId) return redirect('/')
Expand Down
2 changes: 2 additions & 0 deletions app/routes/_layout.login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export const handle: Handle = {
breadcrumb: () => <Link to='/login'>login</Link>,
}

export const config = { runtime: 'nodejs' }

export async function loader({ request }: LoaderArgs) {
const userId = await getUserId(request)
if (userId) return redirect('/')
Expand Down

1 comment on commit aff66f3

@vercel
Copy link

@vercel vercel bot commented on aff66f3 Jul 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.