You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's a basic overview of the authentication flow.
20
20
21
21
1. Users Sign Up or Log In via email.
22
-
2. The Strategy generates and securely sends a Time-based One-Time Password (TOTP) to the user.
23
-
3.Users submit the Code through a Form or Magic Link.
22
+
2. The Strategy generates and securely sends a Time-Based One-Time Password (TOTP) to the user.
23
+
3.The user submits the Code through a Form or Magic Link.
24
24
4. The Strategy validates the TOTP Code, ensuring a secure authentication process.
25
25
<br />
26
26
27
27
> [!NOTE]
28
-
> Remix Auth TOTP is only Remix v2.0+ compatible.
28
+
> Remix Auth TOTP is Remix v2.0+ and React Router v7 compatible.
29
29
30
30
Let's see how we can implement the Strategy into our Remix App.
31
31
32
32
## Email Service
33
33
34
-
We'll require an Email Service to send the codes to our users. Feel free to use any service of choice, such as [Resend](https://resend.com), [Mailgun](https://www.mailgun.com), [Sendgrid](https://sendgrid.com), etc. The goal is to have a sender function similar to the following one.
34
+
We'll require an Email Service to send the codes to our users.
35
+
36
+
Feel free to use any service of choice, such as [Resend](https://resend.com), [Mailgun](https://www.mailgun.com), [Sendgrid](https://sendgrid.com), etc. The goal is to have a sender function similar to the following one.
35
37
36
38
```ts
37
39
exporttypeSendEmailBody= {
@@ -53,7 +55,9 @@ export async function sendEmail(body: SendEmailBody) {
53
55
}
54
56
```
55
57
56
-
In the [Starter Example](https://github.com/dev-xo/totp-starter-example/blob/main/app/modules/email/email.server.ts) project, we can find a straightforward `sendEmail` implementation using [Resend](https://resend.com).
58
+
For a simple implementation, check out the [Remix Starter Example](https://github.com/dev-xo/totp-starter-example/blob/main/app/modules/email/email.server.ts), which provides a clean and straightforward `sendEmail` function using [Resend](https://resend.com).
59
+
60
+
This implementation works with both Remix and React Router v7 applications.
0 commit comments