@@ -4,6 +4,32 @@ The Epic Stack has several security measures in place to protect your users and
4
4
yourself. This (incomplete) document, explains some of the security measures
5
5
that are in place and how to use them.
6
6
7
+ ## TOTP and Two-Factor Authentication
8
+
9
+ Two factor authentication is built-into the Epic Stack. It's managed using a
10
+ custom built TOTP (Time-based One Time Passwords) utility that's been fully
11
+ tested with Google Authenticator and 1Password and is based loosely on existing
12
+ (but outdated) libraries.
13
+
14
+ You can read more about the decision to use TOTP in
15
+ [ the totp decision document] ( ./decisions/014-totp.md ) . The secret and other
16
+ pertinent information is stored in a ` verification ` model (check the Prisma
17
+ schema). This verification model is used as the basis for all TOTP secrets. This
18
+ is used for non-expiring Two-Factor Authentication secrets as well as temporary
19
+ TOTP codes which are emailed to verify a user's ownership of an email/account.
20
+ So it's used for onboarding, forgot password, and change email flows.
21
+
22
+ When a user has 2FA enabled on their account, they also are required to enter
23
+ their 2FA code within 2 hours of performing destructive actions like changing
24
+ their email or disabling 2FA. This time is controlled by the
25
+ ` shouldRequestTwoFA ` utility in the ` login ` full stack component in the resource
26
+ routes.
27
+
28
+ In some cases, entering a TOTP happens in the ` /verify ` route. This is the
29
+ approach taken for email ownership verification. However, in other cases,
30
+ verification happens inline to reduce disorienting the user. This is the
31
+ approach taken for performing destructive actions.
32
+
7
33
## Content Security Policy
8
34
9
35
The Epic Stack uses a strict
0 commit comments