-
Notifications
You must be signed in to change notification settings - Fork 463
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AO3-5171 Make session last 2 weeks (#3059)
* AO3-5171 Make session cookie last 2 weeks * AO3-5171 Make 'remember me for two weeks' the default behavior for the user_credentials cookie * AO3-5171 Remember me should make a session last 3 months instead of 2 weeks * AO3-5171 Fix the spacing in the _passwd view * AO3-5171 If we reset remember_me_for in the right place, we don't need all this extra code * AO3-5171 Remove @remember_me instance variable I temporarily added * AO3-5171 Make session length configurable and add flash message warning users to log out if they are using a public or shared computer * AO3-5171 Change constant names to include units
- Loading branch information
Showing
5 changed files
with
30 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
class UserSession < Authlogic::Session::Base | ||
consecutive_failed_logins_limit 50 | ||
failed_login_ban_for 5.minutes | ||
remember_me true | ||
remember_me_for ArchiveConfig.DEFAULT_SESSION_LENGTH_IN_WEEKS.weeks | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
<% @user_session = UserSession.new unless @user_session %> | ||
<%= form_for @user_session do |f| %> | ||
<dl> | ||
<dt><%= f.label :login, ts("User name:") %></dt> | ||
<dt><%= f.label :login, ts("User name:") %></dt> | ||
<dd><%= f.text_field :login %></dd> | ||
<dt><%= f.label :password, ts("Password:") %></dt> | ||
<dt><%= f.label :password, ts("Password:") %></dt> | ||
<dd><%= f.password_field :password %></dd> | ||
<dt><%= f.label :remember_me, ts("Remember me") %></dt> | ||
<dd><%= f.check_box :remember_me %></dd> | ||
<dt class="landmark"><%= ts("Submit") %></dt> | ||
<dd class="submit actions"><%= f.submit ts("Log in"), :class => 'submit' %></dd> | ||
<dt><%= f.label :remember_me, ts("Remember me") %></dt> | ||
<dd><%= f.check_box :remember_me %></dd> | ||
<dt class="landmark"><%= ts("Submit") %></dt> | ||
<dd class="submit actions"> | ||
<%= f.submit ts("Log in"), class: "submit" %> | ||
</dd> | ||
</dl> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters