summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2023-03-10 19:16:12 -0600
committerHombreLaser <sebastian-440@live.com>2023-03-10 19:16:12 -0600
commitf39235d865412d75625779a557a6c51736798dfa (patch)
treeeac8c00aba703fdf5c7683b448afbd0f15fa5b78 /app
parent6a9c7e493a309670e2dba433331ed75a374aaf39 (diff)
Cambiar peticiones post para que usen formularios
Diffstat (limited to 'app')
-rw-r--r--app/controllers/api/refresh_tokens_controller.rb2
-rw-r--r--app/controllers/api/sessions_controller.rb2
-rw-r--r--app/controllers/api/user_accounts_controller.rb4
3 files changed, 3 insertions, 5 deletions
diff --git a/app/controllers/api/refresh_tokens_controller.rb b/app/controllers/api/refresh_tokens_controller.rb
index fd16079..1f78f4d 100644
--- a/app/controllers/api/refresh_tokens_controller.rb
+++ b/app/controllers/api/refresh_tokens_controller.rb
@@ -3,8 +3,6 @@
module Api
# The controller to generate new tokens.
class RefreshTokensController < AuthenticatedController
- before_action :validate_jwt
-
def create
@current_user_account.update_attribute(:session_key, SecureRandom.hex(16))
@token = service.call(authentication_token[0]['exp'])
diff --git a/app/controllers/api/sessions_controller.rb b/app/controllers/api/sessions_controller.rb
index 64d5464..3d9f315 100644
--- a/app/controllers/api/sessions_controller.rb
+++ b/app/controllers/api/sessions_controller.rb
@@ -29,7 +29,7 @@ module Api
end
def permitted_params
- params.require(:credentials).permit(:email, :password)
+ params.permit(:email, :password)
end
end
end
diff --git a/app/controllers/api/user_accounts_controller.rb b/app/controllers/api/user_accounts_controller.rb
index 85323df..600e168 100644
--- a/app/controllers/api/user_accounts_controller.rb
+++ b/app/controllers/api/user_accounts_controller.rb
@@ -10,7 +10,7 @@ module Api
end
def create
- @user_account = UserAccount.new(permitted_params)
+ @user_account = UserAccount.new(permitted_params.merge(role: 'regular'))
render json: generate_token, status: :ok and return if @user_account.save
@@ -25,7 +25,7 @@ module Api
end
def permitted_params
- params.require(:user_account).permit(:role, :email, :first_name, :last_name, :password)
+ params.permit(:email, :first_name, :last_name, :password)
end
end
end