Class: SwitchUser::Provider::Sorcery
- Inherits:
-
Base
- Object
- Base
- SwitchUser::Provider::Sorcery
show all
- Defined in:
- lib/switch_user/provider/sorcery.rb
Instance Method Summary
collapse
Methods inherited from Base
#clear_original_user, #current_users_without_scope, #login_exclusive, #login_inclusive, #logout_all, #original_user, #original_user=, #remember_current_user
Constructor Details
#initialize(controller) ⇒ Sorcery
Returns a new instance of Sorcery.
4
5
6
|
# File 'lib/switch_user/provider/sorcery.rb', line 4
def initialize(controller)
@controller = controller
end
|
Instance Method Details
#current_user(scope = nil) ⇒ Object
16
17
18
|
# File 'lib/switch_user/provider/sorcery.rb', line 16
def current_user(scope = nil)
@controller.current_user
end
|
#login(user, scope = nil) ⇒ Object
8
9
10
|
# File 'lib/switch_user/provider/sorcery.rb', line 8
def login(user, scope = nil)
@controller.auto_login(user)
end
|
#logout(scope = nil) ⇒ Object
12
13
14
|
# File 'lib/switch_user/provider/sorcery.rb', line 12
def logout(scope = nil)
@controller.logout
end
|