{"action":"created","issue":{"url":"https://api.github.com/repos/phatworx/devise_security_extension/issues/132","repository_url":"https://api.github.com/repos/phatworx/devise_security_extension","labels_url":"https://api.github.com/repos/phatworx/devise_security_extension/issues/132/labels{/name}","comments_url":"https://api.github.com/repos/phatworx/devise_security_extension/issues/132/comments","events_url":"https://api.github.com/repos/phatworx/devise_security_extension/issues/132/events","html_url":"https://github.com/phatworx/devise_security_extension/pull/132","id":81510451,"number":132,"title":"Fix redirect issue in password_expired_controller","user":{"login":"monfresh","id":811150,"avatar_url":"https://avatars.githubusercontent.com/u/811150?v=3","gravatar_id":"","url":"https://api.github.com/users/monfresh","html_url":"https://github.com/monfresh","followers_url":"https://api.github.com/users/monfresh/followers","following_url":"https://api.github.com/users/monfresh/following{/other_user}","gists_url":"https://api.github.com/users/monfresh/gists{/gist_id}","starred_url":"https://api.github.com/users/monfresh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monfresh/subscriptions","organizations_url":"https://api.github.com/users/monfresh/orgs","repos_url":"https://api.github.com/users/monfresh/repos","events_url":"https://api.github.com/users/monfresh/events{/privacy}","received_events_url":"https://api.github.com/users/monfresh/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-27T15:59:38Z","updated_at":"2016-03-09T19:21:11Z","closed_at":"2016-03-09T19:21:11Z","pull_request":{"url":"https://api.github.com/repos/phatworx/devise_security_extension/pulls/132","html_url":"https://github.com/phatworx/devise_security_extension/pull/132","diff_url":"https://github.com/phatworx/devise_security_extension/pull/132.diff","patch_url":"https://github.com/phatworx/devise_security_extension/pull/132.patch"},"body":"The code was doing the opposite of what it was intended to do.\r\nIt was redirecting to root when the resource is present and when the\r\nresource needs a password change.\r\n\r\nAlso, this caused `redirect` to be called multiple times in the same\r\naction because calling `redirect_to :root` will not terminate\r\nexecution of the action. It will continue to execute the rest of the\r\ncode even if the original condition returns true. To stop execution,\r\nyou have to add `and return` or use a guard clause, as I did here.\r\n\r\nI also added tests for the update action, and configured the dummy\r\nRails app to support the tests."},"comment":{"url":"https://api.github.com/repos/phatworx/devise_security_extension/issues/comments/194462587","html_url":"https://github.com/phatworx/devise_security_extension/pull/132#issuecomment-194462587","issue_url":"https://api.github.com/repos/phatworx/devise_security_extension/issues/132","id":194462587,"user":{"login":"monfresh","id":811150,"avatar_url":"https://avatars.githubusercontent.com/u/811150?v=3","gravatar_id":"","url":"https://api.github.com/users/monfresh","html_url":"https://github.com/monfresh","followers_url":"https://api.github.com/users/monfresh/followers","following_url":"https://api.github.com/users/monfresh/following{/other_user}","gists_url":"https://api.github.com/users/monfresh/gists{/gist_id}","starred_url":"https://api.github.com/users/monfresh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monfresh/subscriptions","organizations_url":"https://api.github.com/users/monfresh/orgs","repos_url":"https://api.github.com/users/monfresh/repos","events_url":"https://api.github.com/users/monfresh/events{/privacy}","received_events_url":"https://api.github.com/users/monfresh/received_events","type":"User","site_admin":false},"created_at":"2016-03-09T19:21:11Z","updated_at":"2016-03-09T19:21:11Z","body":"I'm closing this PR because it looks like a fix was [already made](https://github.com/phatworx/devise_security_extension/commit/83d2d65cfd64d27427e4ef28a3bcd8bd20c685b7). However, that fix is still not fully tested, so I'll submit a new PR with more tests."}}