Its been a while
CI / scan_ruby (push) Failing after 2m13s
CI / lint (push) Failing after 20s

This commit is contained in:
Jason Jordan
2026-07-23 10:41:46 -04:00
parent 16fadfd529
commit 9853d58469
83 changed files with 1978 additions and 243 deletions
@@ -0,0 +1,49 @@
# frozen_string_literal: true
class Users::SessionsController < Devise::SessionsController
respond_to :json
# POST /resource/sign_in
# def create
# super
# end
# DELETE /resource/sign_out
# def destroy
# super
# end
private
def respond_with(resource, _opts = {})
puts
render json: {
status: { code: 200, message: 'Logged in successfully.' },
user: {
id: resource.id,
email: resource.email,
name: resource.name,
role: resource.role,
role_id: resource.role_id,
jti: resource.jti,
keychain: resource.keychain,
created_at: resource.created_at,
updated_at: resource.updated_at
}
}, status: :ok
end
def respond_to_on_destroy
if current_user
render json: {
status: 200,
message: "Logged out successfully."
}, status: :ok
else
render json: {
status: 401,
message: "Couldn't find an active session."
}, status: :unauthorized
end
end
end