Profile + Edit Bio + Logout + styling
- Added handler for editing bio to handlers.js - Added openProfile() and closeProfile() buttons in AppWindowContainer (Profile page is global) - Added Logout and Profile functionality to Sidebar.js - SidebarItem(text).onClick() fires twice, unable to resolve - Adjust Login page styling - Added onLogout() to index.js (removes auth_token) - Added Profile.js, displays user's profile picture (placeholder), name, and bio. User can edit bio. - Added removeAuthToken() to util.js - Added /signout to vite config
This commit is contained in:
10
src/index.js
10
src/index.js
@@ -150,6 +150,16 @@ let Global = class {
|
||||
// navigateTo("/")
|
||||
}
|
||||
|
||||
async onLogout() {
|
||||
await util.removeAuthToken()
|
||||
await fetch(`${util.HOST}/signout`, {
|
||||
method: "GET",
|
||||
credentials: "include"
|
||||
});
|
||||
this.profile = null
|
||||
AuthPage()
|
||||
}
|
||||
|
||||
constructor() {
|
||||
window.addEventListener("navigate", this.onNavigate)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user