feat: TOTP (two-factor) Authentication (#55)

* Working on some initial prototype stuff for TOTP

* Fixed a bug that prevented the change password menu from working

* Enable/disable totp working

* Added the new login procedure including TOTP! :)

* misc: Changed bad description for the TOTP_SECRET env var

* I forgot to include the migration for the new prisma stuff

* fix: refresh user context instead refreshing the page

* refactor: simplify totp error handling

* Removed U2F tab + format schema

* fix: tokens not saved in cookies

* refactor: deleted commented out code

* refactor: move password text to input description

* refactor: remove tabler icon package

Co-authored-by: Elias Schneider <login@eliasschneider.com>
Co-authored-by: Elias Schneider <58886915+stonith404@users.noreply.github.com>
This commit is contained in:
Steve
2022-12-21 11:58:37 -05:00
committed by GitHub
parent 0616a68bd2
commit 16480f6e95
27 changed files with 946 additions and 127 deletions

View File

@@ -3,6 +3,7 @@ type User = {
username: string;
email: string;
isAdmin: boolean;
totpVerified: boolean;
};
export type CreateUser = {
@@ -26,4 +27,9 @@ export type UpdateCurrentUser = {
export type CurrentUser = User & {};
export type UserHook = {
user: CurrentUser | null;
setUser: (user: CurrentUser | null) => void;
};
export default User;