Commit 22c96d1
Changed files (2)
app
controllers
views
oauths
app/controllers/oauths_controller.rb
@@ -22,11 +22,6 @@ class OauthsController < ApplicationController
response.headers['Cache-Control'] = 'no-store'
response.headers['Pragma'] = 'no-cache'
Authorization.find_by!(code: params[:code]).revoke!
- render json: {
- access_token: SecureRandom.hex(20),
- token_type: 'access',
- expires_in: 1.hour.to_i,
- refresh_token: SecureRandom.hex(20)
- }, status: :ok
+ render formats: :json
end
end
app/views/oauths/token.json.jbuilder
@@ -0,0 +1,4 @@
+json.access_token SecureRandom.hex(20)
+json.token_type 'access'
+json.expires_in 1.hour.to_i
+json.refresh_token SecureRandom.hex(20)