X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/86dbcb55f25219edc4f0aa93b209357e4cac0621..2233edbcfa15d532c2232e5e71a2a2495e3a72eb:/app/controllers/users_controller.rb diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index a1129339e..121d050b5 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -123,7 +123,7 @@ class UsersController < ApplicationController :form_action => %w[accounts.google.com *.facebook.com login.live.com github.com meta.wikimedia.org] ) - if params[:user] && params[:user][:display_name] && params[:user][:description] + if request.post? if params[:user][:auth_provider].blank? || (params[:user][:auth_provider] == current_user.auth_provider && params[:user][:auth_uid] == current_user.auth_uid) @@ -131,7 +131,7 @@ class UsersController < ApplicationController redirect_to user_account_url(current_user) if current_user.errors.count.zero? else session[:new_user_settings] = params - redirect_to auth_url(params[:user][:auth_provider], params[:user][:auth_uid]) + redirect_to auth_url(params[:user][:auth_provider], params[:user][:auth_uid]), :status => :temporary_redirect end elsif errors = session.delete(:user_errors) errors.each do |attribute, error| @@ -151,7 +151,7 @@ class UsersController < ApplicationController def lost_password @title = t "users.lost_password.title" - if params[:email] + if request.post? user = User.visible.find_by(:email => params[:email]) if user.nil? @@ -270,9 +270,13 @@ class UsersController < ApplicationController end def login + append_content_security_policy_directives( + :form_action => %w[accounts.google.com *.facebook.com login.live.com github.com meta.wikimedia.org] + ) + session[:referer] = safe_referer(params[:referer]) if params[:referer] - if params[:username].present? && params[:password].present? + if request.post? session[:remember_me] ||= params[:remember_me] password_authentication(params[:username], params[:password]) end