This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { LoaderFunctionArgs, ActionFunctionArgs } from '@remix-run/node' | |
import { Form, useLoaderData } from '@remix-run/react' | |
import { json } from '@remix-run/node' | |
// Authenticator / Email Templates: | |
// https://github.com/dev-xo/totp-starter-example/tree/main/app/modules | |
import { authenticator } from '~/modules/auth/auth.server.ts' | |
import { getSession, commitSession } from '~/modules/auth/auth-session.server.ts' | |
export async function loader({ request }: LoaderFunctionArgs) { | |
await authenticator.isAuthenticated(request, { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { DataFunctionArgs } from '@remix-run/node' | |
import { json, redirect } from '@remix-run/node' | |
import { Form } from '@remix-run/react' | |
import Stripe from 'stripe' | |
export async function loader({ request }: DataFunctionArgs) { | |
// Gets params from URL. | |
const url = new URL(request.url) | |
const userId = url.searchParams.get('userId') | |
const successPayment = url.searchParams.get('success') |