Class: StandardId::Web::SessionsController
- Inherits:
-
BaseController
- Object
- ApplicationController
- BaseController
- StandardId::Web::SessionsController
show all
- Defined in:
- app/controllers/standard_id/web/sessions_controller.rb
Instance Method Summary
collapse
all_controllers, authenticated_controllers, public_controllers, register, registry_snapshot, reset_registry!
Instance Method Details
#destroy ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'app/controllers/standard_id/web/sessions_controller.rb', line 11
def destroy
session = current_account.sessions.find(params[:id])
if session == current_session
revoke_current_session!
redirect_to "/", notice: "Session revoked. You have been signed out."
else
session.revoke!
redirect_to sessions_path, notice: "Session revoked successfully"
end
rescue ActiveRecord::RecordNotFound
redirect_to sessions_path, alert: "Session not found"
end
|
#index ⇒ Object
6
7
8
9
|
# File 'app/controllers/standard_id/web/sessions_controller.rb', line 6
def index
@sessions = current_account.sessions.active.order(created_at: :desc)
@current_session = current_session
end
|