Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Commit

Permalink
Fix bug that does not keep login
Browse files Browse the repository at this point in the history
  • Loading branch information
김창근 committed Oct 15, 2014
1 parent b8c0bf9 commit 004bc9b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/controllers/UserApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ private static Result loginByFormRequest() {
if (!authenticate.isAnonymous()) {
addUserInfoToSession(authenticate);

if (sourceUser.rememberMe) {
if (authInfoForm.get().rememberMe) {
setupRememberMe(authenticate);
}

Expand Down Expand Up @@ -236,7 +236,7 @@ private static Result loginByAjaxRequest() {
if (!authenticate.isAnonymous()) {
addUserInfoToSession(authenticate);

if (sourceUser.rememberMe) {
if (authInfoForm.get().rememberMe) {
setupRememberMe(authenticate);
}

Expand Down
7 changes: 7 additions & 0 deletions app/models/AuthInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,11 @@ public class AuthInfo {
public String loginIdOrEmail;
@Constraints.Required
public String password;

/**
* used for enabling remember me feature
*
* remember me = keep a use logged in
*/
public boolean rememberMe;
}
4 changes: 3 additions & 1 deletion public/javascripts/common/yobi.LoginDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ $(function(){
htElement.welForm = htElement.welDialog.find("form");
htElement.welInputId = htElement.welDialog.find("input[name='loginIdOrEmail']");
htElement.welInputPw = htElement.welDialog.find("input[name='password']");
htElement.welInputRememberMe = htElement.welDialog.find("input[name='rememberMe']");
htElement.welLoginError = htElement.welDialog.find(".error");
htElement.welLoginErrorMsg = htElement.welLoginError.find(".error-message");
}
Expand Down Expand Up @@ -74,7 +75,8 @@ $(function(){
"dataType": "json",
"data": {
"loginIdOrEmail" : htElement.welInputId.val(),
"password": htElement.welInputPw.val()
"password": htElement.welInputPw.val(),
"rememberMe": htElement.welInputRememberMe.is(":checked")
}
}).done(function(){
document.location.reload();
Expand Down

0 comments on commit 004bc9b

Please sign in to comment.