-
-
Notifications
You must be signed in to change notification settings - Fork 771
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
Ensure avatar auth #1587
Ensure avatar auth #1587
Conversation
If user is unauthenticated forward to github login so that they don't waste time
Merge latest master
Codecov Report
@@ Coverage Diff @@
## master #1587 +/- ##
==========================================
+ Coverage 28.4% 29.93% +1.53%
==========================================
Files 130 130
Lines 9592 9596 +4
Branches 1241 1243 +2
==========================================
+ Hits 2725 2873 +148
+ Misses 6769 6619 -150
- Partials 98 104 +6
Continue to review full report at Codecov.
|
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.
LGTM
app/dashboard/views.py
Outdated
@@ -522,6 +522,11 @@ def send_tip_2(request): | |||
|
|||
def onboard(request, flow): | |||
"""Handle displaying the first time user experience flow.""" | |||
|
|||
if not request.user or not request.user.is_authenticated: |
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.
This is wrong. This will cause anyone who goes to the onboarding flow to be redirected to the github login. That is not expected. We want this only for the standalone avatar page. So this check should be only if someone is trying to access endpoints like: /onboard/contributor/?steps=avatar
or /onboard/profile
and so on.
… github step isn't present
@premachb Thanks for your contribution! cc @owocki @SaptakS This will ensure we're redirecting to auth for any user passing Also, I updated the if check by dropping Thanks again for the contribution! |
@mbeacom makes sense. |
Description
Ensure user is logged in before going through onboarding flow by redirecting to GitHub login if a user is not authenticated.
Checklist
Affected core subsystem(s)
Dashboard folder more specifically the Onboarding Flow.
Testing
Simple change that checks and redirects and I've confirmed this doesn't break if the user is logged in.
Refers/Fixes
Refs: #1554