-
Notifications
You must be signed in to change notification settings - Fork 21
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
Fix: skip account setup when ALLOW_UNAUTHENTICATED is true #203
Conversation
Reviewer's Guide by SourceryThis pull request introduces changes to skip the account setup process and hide the "Logoff" button when Sequence diagram for authentication flow changessequenceDiagram
actor User
participant App
participant Auth
participant DB
User->>App: Visit /
alt ALLOW_UNAUTHENTICATED is true
App->>Auth: Generate temporary user ID
Auth-->>App: Return JWT token
App-->>User: Show main page
else ALLOW_UNAUTHENTICATED is false
alt FIRST_RUN is true
App-->>User: Redirect to /setup
else No auth cookie
App-->>User: Redirect to /login
else Has auth cookie
App->>Auth: Verify JWT
Auth-->>App: User info
App->>DB: Check user exists
DB-->>App: User status
alt User exists
App-->>User: Show main page
else User doesn't exist
App-->>User: Redirect to /login
end
end
end
State diagram for Header componentstateDiagram-v2
[*] --> CheckAuthSettings
CheckAuthSettings --> UnauthenticatedHeader: ALLOW_UNAUTHENTICATED=true
CheckAuthSettings --> AuthenticatedHeader: ALLOW_UNAUTHENTICATED=false
state UnauthenticatedHeader {
[*] --> ShowNavLinks
ShowNavLinks --> HideLogoutButton
}
state AuthenticatedHeader {
[*] --> ShowNavLinks
ShowNavLinks --> ShowLogoutButton
}
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @tejashah88 - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Looks good! Thanks for this! Will check out the calibre error in the build process |
30fb4cb
to
538c5b6
Compare
Fixes #201 with the following changes:
ALLOW_UNAUTHENTICATED
at appropriate locations when visitinglocalhost:3000
.ALLOW_UNAUTHENTICATED
is set to true.Preview of header change when
ALLOW_UNAUTHENTICATED=true
:Tested with the following environment:
bun install
&bun run dev
)Environment variables set during local development:
Let me know if any other changes are needed. Looking forward to your feedback @C4illin!
Summary by Sourcery
Bug Fixes: