-
Notifications
You must be signed in to change notification settings - Fork 4
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
Replace 'Login with...' page with auto-redirect script #29
Conversation
Screen cap of new flow: Screen.Recording.2023-08-10.at.7.11.47.PM.mov |
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 works on my machine, and assuming no issues with other clients should suffice!
If you're interested in digging deeper, I imagine there should be a better way to hijack the flow in the controller, before we hit the view?
I looked into it briefly and found that by creating a new
method in app/controllers/auth/sessions_controller.rb
, I was able to get into the flow before the view renders:
def new
redirect_to('https://mozilla.com')
# HTTP.post('https://mastodon.mozsoc.local/auth/auth/openid_connect')
end
Getting it to trigger the OIDC flow is of course another matter... we'd need to spend more time on it.
|
||
- unless omniauth_only? | ||
= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| |
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.
Could we keep all this but add a new param instead?
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.
yes, I realized I can use the sso_redirect param that was defined in mastodon#26083, if I merge that one in
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.
Yay!
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.
Could actually merge this back upstream too with that.
@toufali re: hijacking this flow earlier - I've gone down that rabbit hole a few times and unfortunately come up blank each time. My findings are:
But I gently lay down the gauntlet to be picked up now or in the future! |
e2d8649
to
a9b14cc
Compare
a9b14cc
to
d662634
Compare
Addressed comments from above @toufali I could not for the life of me figure out how to get I was aggressive about minimizing the HTML that is rendered in the redirect case, so that the page loads and redirects as fast as possible. |
a88d8bf
to
4fe0aa5
Compare
There is also
localStorage
logic in here to support the "signup intent" feature (two separate buttons). That will be a separate PR on Elk though.I used
localStorage
because I can't figure out how to prevent Mastodon from stripping all the URL params when redirecting to/auth/sign_in
.First part of https://mozilla-hub.atlassian.net/browse/SOCIALPLAT-104