Skip to content

Sudo Mode Implementation Exploration #10671

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

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Conversation

davidcornu
Copy link
Member

This is proof-of-concept code. See #10653 for details.

@davidcornu davidcornu force-pushed the david/push-rsxovztqnmzr branch from 7f4b0f9 to 4784129 Compare June 20, 2025 20:43
Comment on lines +165 to +167
sms: false,
).run

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sms: false,
).run
sms: false,
).run

Comment on lines +114 to 115
end
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
end
end
end
end

Comment on lines +117 to 118
end
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
end
end
end
end

Comment on lines +5 to +8
<%= form_tag(request.path, method: request.request_method_symbol) do %>
<%
Rack::Utils
.parse_query(request.request_parameters.to_query)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<%= form_tag(request.path, method: request.request_method_symbol) do %>
<%
Rack::Utils
.parse_query(request.request_parameters.to_query)
<%= form_tag(request.path, method: request.request_method_symbol) do %>
Rack::Utils
.parse_query(request.request_parameters.to_query)

@@ -20,6 +20,7 @@ class UsersController < ApplicationController
:complete_sms_auth_verification,
:start_sms_auth_verification]
before_action :set_shown_private_feature_previews, only: [:edit, :edit_featurepreviews, :edit_security, :edit_admin]
before_action :enforce_sudo_mode, only: [:update]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is super clean - thank you for implementing it this way

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to this model LGTM - only comment is I would have implemented preceding_login instead of inital

Comment on lines +7 to +8
Rack::Utils
.parse_query(request.request_parameters.to_query)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could make this a partial that we include in all the forms rendered from the LoginsController and then have some shared logic in LoginsController#complete to handle input from that.

Copy link
Member

@sampoder sampoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Model changes LGTM - as you mentioned in the video, I think the big thing will be reusing as much of the login controller code as possible. I'm happy to jump on a call to talk through that stuff at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants