From b7a537f540a435be74ac6aee9ae63c1f1a7cab53 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Thu, 22 Dec 2022 21:27:38 -0800 Subject: [PATCH] Fix token generation on signup --- app/controllers/api/v1/users_controller.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/api/v1/users_controller.rb b/app/controllers/api/v1/users_controller.rb index fdab8b0..267e23f 100644 --- a/app/controllers/api/v1/users_controller.rb +++ b/app/controllers/api/v1/users_controller.rb @@ -13,14 +13,14 @@ module Api def create user = User.new(user_params) - token = Doorkeeper::AccessToken.create!( - application_id: nil, - resource_owner_id: user.id, - expires_in: 30.days, - scopes: 'public' - ).token - if user.save! + token = Doorkeeper::AccessToken.create!( + application_id: nil, + resource_owner_id: user.id, + expires_in: 30.days, + scopes: 'public' + ).token + return render json: UserBlueprint.render({ id: user.id, username: user.username,