Update authentication method
This commit is contained in:
17
slices/admin/commands/sessions/validate.rb
Normal file
17
slices/admin/commands/sessions/validate.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
module Admin
|
||||
module Commands
|
||||
module Sessions
|
||||
class Validate
|
||||
include Deps["repos.login_tokens_repo"]
|
||||
|
||||
def call(token:)
|
||||
user_id = login_tokens_repo.by_token(token: token).user_id
|
||||
if user_id
|
||||
login_tokens_repo.delete_all
|
||||
user_id
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user