-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Frontend: Hide Elements based on Login (#167)
* fix: prevent default * Feat: Loading login page now deletes cookie, allowing user effectively log out. * Feat: Upload script checks cookie to see if user is logged in. Redirects if they are not. * Feat: Added user svelte store to keep track of login status * Feat: Hide upload button if user not logged in * Login changes to logout if user signs in * Feat: Hide edit button if user not logged in. Redirect from edit page if user not logged in. * Made the header check to see if there is an auth cookie to check if there should be a login session - If there is one, then it sets the site login status to true. * Refactor: Small code change * Refactor: Changed user store variables from int to bool * Refactor: Removed unused imports from router.svelte * Changed test user password from hunter2 to test, to make it easier to type. * fix: svelte/store comes with svelte --------- Co-authored-by: xnought <bertuccd@oregonstate.edu>
- Loading branch information
1 parent
efc7715
commit 86f4a4d
Showing
8 changed files
with
73 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {writable} from 'svelte/store'; | ||
|
||
export const user = writable({ | ||
loggedIn: false, | ||
username: "", | ||
admin: true | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,4 @@ | |
|
||
<style> | ||
/* put stuff here */ | ||
</style> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters