Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
birger
users
Commits
6c886a74
Commit
6c886a74
authored
Aug 04, 2018
by
mh
Browse files
unify session destroy
parent
63f57acc
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/controllers/application_controller.rb
View file @
6c886a74
...
...
@@ -62,4 +62,9 @@ class ApplicationController < ActionController::Base
session
[
:expires_at
]
=
15
.
minutes
.
from_now
.
to_i
end
helper_method
:update_session_expiry
private
def
destroy_session
session
[
:user_id
]
=
nil
session
[
:trees_recovery_token
]
=
nil
end
end
app/controllers/delete_account_controller.rb
View file @
6c886a74
...
...
@@ -4,8 +4,9 @@ class DeleteAccountController < ApplicationController
begin
ApiBackend
::
delete_account
(
current_user
,
p
)
flash
[
:notice
]
=
:delete_success
s
es
sion
[
:user_id
]
=
nil
d
es
troy_session
redirect_to
'/'
return
rescue
ApiBackend
::
ApiError
=>
e
if
e
.
api_msg
==
'auth_fail'
flash
[
:notice
]
=
:auth_fail
...
...
app/controllers/sessions_controller.rb
View file @
6c886a74
...
...
@@ -58,8 +58,7 @@ class SessionsController < ApplicationController
end
def
destroy
session
[
:user_id
]
=
nil
session
[
:trees_recovery_token
]
=
nil
destroy_session
redirect_to
'/login'
end
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment