Skip to content

Commit 9d3a9ea

Browse files
committed
feat(auth): implement authentication manager with email and OAuth support
- Added AuthManager class to handle user authentication and state management. - Integrated Supabase for authentication, including email/password and OAuth providers (Google, GitHub, Apple). - Implemented UI for authentication with options to sign in, sign up, and continue as guest. - Added user avatar display and update functionality based on authentication state. - Enhanced application initialization to show authentication screen on first run. - Updated styles for user avatar and authentication UI components.
1 parent 99fc200 commit 9d3a9ea

File tree

8 files changed

+1319
-3
lines changed

8 files changed

+1319
-3
lines changed

package-lock.json

Lines changed: 150 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
},
1717
"dependencies": {
1818
"@aptabase/tauri": "^0.4.1",
19+
"@supabase/supabase-js": "^2.50.0",
1920
"@tauri-apps/api": "^2.5.0",
2021
"@tauri-apps/plugin-dialog": "^2.2.2",
2122
"@tauri-apps/plugin-notification": "^2",

src/index.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,27 @@
3939
</div>
4040

4141
<div class="sidebar-bottom">
42+
<div class="user-avatar-container" id="user-avatar-container" style="display: none;">
43+
<div class="user-avatar" id="user-avatar">
44+
<img id="user-avatar-img" src="" alt="User Avatar" style="display: none;">
45+
<div id="user-avatar-fallback" class="avatar-fallback">G</div>
46+
</div>
47+
<div class="user-info" id="user-info">
48+
<span class="user-name" id="user-name">Guest</span>
49+
<div class="user-actions">
50+
<button class="user-action-btn" id="user-sign-out" title="Sign Out" style="display: none;">
51+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
52+
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 005.25 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9" />
53+
</svg>
54+
</button>
55+
<button class="user-action-btn" id="user-sign-in" title="Sign In">
56+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
57+
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z" />
58+
</svg>
59+
</button>
60+
</div>
61+
</div>
62+
</div>
4263
<button class="sidebar-icon-large" id="settings-nav" data-view="settings" title="Settings">
4364
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
4465
<path stroke-linecap="round" stroke-linejoin="round"

0 commit comments

Comments
 (0)