diff options
-rw-r--r-- | app/controllers/api/authentications_controller.rb | 18 | ||||
-rw-r--r-- | config/routes.rb | 3 |
2 files changed, 21 insertions, 0 deletions
diff --git a/app/controllers/api/authentications_controller.rb b/app/controllers/api/authentications_controller.rb new file mode 100644 index 0000000..90f04d8 --- /dev/null +++ b/app/controllers/api/authentications_controller.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Api + # The controller that handles authentications. + class AuthenticationsController < ApplicationController + def create; end + + def destroy; end + + def refresh; end + + private + + def permitted_params + params.require(:user_account).permit(:email, :password) + end + end +end
\ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index ff9a773..45fa051 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -6,6 +6,9 @@ Rails.application.routes.draw do # Defines the root path route ("/") # root "articles#index" namespace :api do + post '/refresh_token', to: 'authentications#refresh' + post '/authenticate', to: 'authentications#create' + delete '/logout', to: 'authentications#destroy' resources :user_accounts, only: %i[show create] end end |