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 a7bf538..ea50113 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 051d270..a78916d 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>