mirror of
https://github.com/internetee/registry.git
synced 2025-07-30 22:46:22 +02:00
Refactor Devise integration
- Use scoped users - Use the named route helpers instead of hardcoded paths
This commit is contained in:
parent
c31f507c25
commit
9684c8e59f
52 changed files with 313 additions and 280 deletions
|
@ -3,9 +3,9 @@ class Registrar
|
|||
skip_authorization_check
|
||||
|
||||
def switch
|
||||
raise 'Cannot switch to unlinked user' unless current_user.linked_with?(new_user)
|
||||
raise 'Cannot switch to unlinked user' unless current_registrar_user.linked_with?(new_user)
|
||||
|
||||
sign_in(new_user)
|
||||
sign_in(:registrar_user, new_user)
|
||||
redirect_to :back, notice: t('.switched', new_user: new_user)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue