-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/auth #13
Open
voidKandy
wants to merge
19
commits into
main
Choose a base branch
from
feature/auth
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature/auth #13
Conversation
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
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Auth PR
useAuth changes
signIn function
I updated our
useAuth
hook to export asignIn
function:This is simple enough, all it does is direct users to 0Auth's login endpoint, which:
New useEffect
The call to
useEffect
in ouruseAuth
hook now does the following:sessionStorage
, if there is,user
is set and the hook returnssessionStorage
, check if 0Auth'suseUser
has a useruseAuth
returns, and there is no useruser
is referred to asuserState
and is 0Auth'sUserProfile
interface:useUser
does contain a user, we checkapi/users/{user.sub}
(if this endpoint returns a user it means we have seen them before and already have user information on them)api/users/{user.sub}
returns null, we send the entireUserProfile
toapi/users/create
to create our own version of the user (right now this endpoint just mocks some user data)api/users/{user.sub}
, orapi/users/create
. Both of these endpoints returnUserProfileData
if successful./dashboard
moved to/{userName}
Pretty self explanatory, I moved this route to match the spec
ProfileHeader
The header of what was in
/dashboard
has been moved to theProfileHeader
component. This contains everything the previous header had plus the following:/settings
The Followers/Following counts/buttons do nothing when clicked right now and are not in their own component.
ProfileHeader
has two empty function definitions foronFollowers/FollowingClicked
, this could be moved very easily, but I didn't see a reason to fully abstract theProfileStats
rendering, so they live inProfileHeader
for now.ProfileHeader
queries/api/users/${user.sub_token_claim}/stats
in auseEffect
hook to get the profile stats; right now this endpoint returns mock data.Settings
I tried to mimic the settings page of huggingface for this. Adding new tabs should be very easy as I've created a
SettingsTab
component and current tab state management to the page.None of the buttons do anything.
Important
As stated before, we need to do some minor setup for 0Auth to work:
Please feel free to DM me on discord for us to get this squared away