-
Notifications
You must be signed in to change notification settings - Fork 8.6k
FIX: DiscourseConnect and auth_immediately = false #34424
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
Conversation
b67f9e0
to
0bed875
Compare
@pmusaraj I've simplified the logic and made the |
DiscourseConnect "required" auth_immediately to also be enabled to work properly but this was incorrect. This fixes that assumption and add specs to cover all combinations of - login_required - auth_immediately - visiting / - visiting / and clicking the login button - visiting /login directly Internal ref - t/161485
instead of when some combination of site settings is present.
0bed875
to
8899044
Compare
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.
Looks good overall, just the one question about dropping the signup: true
parameter.
@@ -35,6 +35,7 @@ export default class extends DiscourseRoute { | |||
const { referrer } = document; | |||
const { canSignUp } = this.controllerFor("application"); | |||
const { isOnlyOneExternalLoginMethod, singleExternalLogin } = this.login; | |||
const redirect = auth_immediately || login_required || !from || wantsTo; |
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.
For a follow-up, it's a little unclear what the !from
and wantTo
properties here represent.
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.
from
comes from the transition
object which lets us differentiate between in-app navigation vs full-page navigation.
wantsTo
is when you click a button in the app, for which the event bubbles up to the application
route and calls either the showLogin
or showCreateAccount
action.
More than happy to rename them if you have ideas!
DiscourseConnect "required" auth_immediately to also be enabled to work properly but this was incorrect. This fixes that assumption and add specs to cover all combinations of - login_required - auth_immediately - visiting / - visiting / and clicking the login button - visiting /login directly Internal ref - t/161485
DiscourseConnect "required" auth_immediately to also be enabled to work properly but this was incorrect. This fixes that assumption and add specs to cover all combinations of - login_required - auth_immediately - visiting / - visiting / and clicking the login button - visiting /login directly Internal ref - t/161485
DiscourseConnect "required" auth_immediately to also be enabled to work properly but this was incorrect.
This fixes that assumption and add specs to cover all combination of
Internal ref - t/161485