Fix token generation on signup
This commit is contained in:
parent
041f8ee189
commit
b7a537f540
1 changed files with 7 additions and 7 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue