]> git.openstreetmap.org Git - rails.git/commitdiff
Fix two issues with the remember_me_openid button
authorThijs Alkemade <thijsalkemade@gmail.com>
Sun, 1 Feb 2015 10:33:01 +0000 (10:33 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 1 Feb 2015 10:33:45 +0000 (10:33 +0000)
1. It didn't work, the code only checked the remember_me button, not
   the remember_me_openid button.

2. It did not have a unique id, making the label next to it not work
   for selecting the checkbox.

app/controllers/user_controller.rb
app/views/user/login.html.erb

index a7bf53824821a4559672b9d1446eccb7dc74bee3..ea50113e5d2478a2652f35a1517541cba5947c20 100644 (file)
@@ -276,12 +276,13 @@ class UserController < ApplicationController
 
   def login
     if params[:username] or using_open_id?
-      session[:remember_me] ||= params[:remember_me]
       session[:referer] ||= params[:referer]
 
       if using_open_id?
+        session[:remember_me] ||= params[:remember_me_openid]
         openid_authentication(params[:openid_url])
       else
+        session[:remember_me] ||= params[:remember_me]
         password_authentication(params[:username], params[:password])
       end
     end
index 051d270a4201164a09c8767790c64aae1e5bf320..a78916dcc54267e54c138b77518110aebecb6442 100644 (file)
@@ -54,7 +54,7 @@
             <span class="minorNote">(<a href="<%= t 'user.account.openid.link' %>" target="_new"><%= t 'user.account.openid.link text' %></a>)</span>
           </div>
 
-          <div id="remember_me_openid" class='form-row'>
+          <div class='form-row'>
             <%= check_box_tag "remember_me_openid", "yes", false, :tabindex => 5 %>
             <label class="standard-label" for="remember_me_openid"><%= t 'user.login.remember' %></label>
           </div>