Last active
November 5, 2024 19:29
-
-
Save Hasstrup/b4d8cbe015bf3260984621151c63341b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
class UsersController < ApplicationController | |
def register | |
context = ::Users::Contexts::Registration.call(input: users_registration_input) | |
return error_response(context.message) unless context.success? | |
render json: ::Tokens::TokenBlueprint.render(context.payload), status: :ok | |
end | |
def authenticate | |
context = ::Users::Contexts::Authentication.call(input: users_authentication_input) | |
return error_response(context.message) unless context.success? | |
render json: ::Tokens::TokenBlueprint.render(context.payload), status: :ok | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment