feat(auth): enhance authentication flow with TOTP and admin reset features
- Added TOTP setup, enable, and disable functions to the API. - Implemented admin reset request and confirmation functionalities. - Updated AuthPage to handle new reset functionalities and TOTP inputs. - Enhanced auth store to manage user creation, deletion, and listing. - Improved AppShell and SettingsDialog to support user management features. - Refactored API calls for better organization and clarity.
This commit is contained in:
1 parent
ac08be0248
commit
652e81dacb
9 files changed
+4333
-3737
No files matched your search
@@ -2,17 +2,23 @@
|
||||
import { AuthPage as SharedAuthPage } from '@gabriel20xx/shared-code/web-ui';
|
||||
import { useAuth } from '$lib/features/auth/auth.svelte.js';
|
||||
|
||||
let { setupRequired } = $props();
|
||||
let { setupRequired, loading = false, error = '' } = $props();
|
||||
const auth = useAuth();
|
||||
|
||||
const onLogin = (input) => auth.login(input.identifier, input.password);
|
||||
const onLogin = (input) => auth.login(input.identifier, input.password, input.totpToken);
|
||||
const onSetup = (input) => auth.setup(input.username, input.email, input.password);
|
||||
const onRequestReset = () => auth.requestAdminReset();
|
||||
const onConfirmReset = (code) => auth.confirmAdminReset(code);
|
||||
</script>
|
||||
|
||||
<SharedAuthPage
|
||||
brand="CollabTable"
|
||||
tagline="Collaborative tables for your team"
|
||||
{setupRequired}
|
||||
{loading}
|
||||
{error}
|
||||
{onLogin}
|
||||
{onSetup}
|
||||
{onRequestReset}
|
||||
{onConfirmReset}
|
||||
/>
|
||||
Reference in new issue
Block a user