Refactor authentication method to requireUser

Replaced the requireAuth method with requireUser to improve clarity and modified all instances where it was used. Renamed the import throughout multiple files and services and made changes accordingly, thus making it more specific and understandable that a logged-in user is needed. The return type of the method was also updated from Session to User to more accurately reflect the information it provides.
This commit is contained in:
giancarlo
2024-03-29 15:52:32 +08:00
parent 40c730141a
commit 2b0fbc445b
22 changed files with 121 additions and 105 deletions

View File

@@ -17,7 +17,7 @@
"./server-component-client": "./src/clients/server-component.client.ts",
"./browser-client": "./src/clients/browser.client.ts",
"./check-requires-mfa": "./src/check-requires-mfa.ts",
"./require-auth": "./src/require-auth.ts",
"./require-user": "./src/require-user.ts",
"./hooks/*": "./src/hooks/*.ts",
"./components/*": "./src/components/*.tsx",
"./database": "./src/database.types.ts"