Skip to content
Snippets Groups Projects

Add controllers and frontend for DPoP

Merged Ameya Darshan requested to merge ameya-dpop-ui into master
Compare and Show latest version
10 files
+ 189
21
Compare changes
  • Side-by-side
  • Inline
Files
10
@@ -80,6 +80,23 @@ def rotate
end
end
def toggle_dpop
unless Feature.enabled?(:dpop_authentication, current_user)
redirect_to user_settings_personal_access_tokens_path
return
end
result = UserPreferences::UpdateService.new(current_user, dpop_params).execute
if result.success?
flash[:notice] = _('DPoP preference updated.')
else
flash[:warning] = _('Unable to update DPoP preference.')
end
redirect_to user_settings_personal_access_tokens_path
end
private
def finder(options = {})
@@ -90,6 +107,10 @@ def personal_access_token_params
params.require(:personal_access_token).permit(:name, :expires_at, :description, scopes: [])
end
def dpop_params
params.require(:user).permit(:dpop_enabled)
end
def set_index_vars
@scopes = Gitlab::Auth.available_scopes_for(current_user)
@active_access_tokens, @active_access_tokens_size = active_access_tokens
Loading