Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: otr/authorization-server
base: 40936398e0
...
head fork: otr/authorization-server
compare: d8edb1cb54
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 9 files changed
  • 0 commit comments
  • 1 contributor
View
5 app/controllers/public_clients/tokens_controller.rb
@@ -70,7 +70,7 @@ def create
# the redirect uri
redirect_uri = params[ :redirect_uri ] || client.redirect_uri
-
+
# does the redirect uri associated with the authorization grant
# match the given (or default) redirect uri?
unless authorization.redirect_uri != redirect_uri
@@ -84,6 +84,9 @@ def create
Rails.application.config.authorization_token_lifetime
)
+ # the resource owner
+ @resource_owner = authorization.resource_owner
+
# destroy the authorization grant
authorization.destroy
View
4 app/views/confidential_clients/registrations/create.notator
@@ -1 +1,3 @@
-json << render( :partial => '/tokens/token', :object => @token )
+json << render( :partial => '/tokens/token',
+ :object => @token,
+ :locals => { :resource_owner => @resource_owner } )
View
4 app/views/confidential_clients/registrations/update.notator
@@ -1 +1,3 @@
-json << render( :partial => '/tokens/token', :object => @token )
+json << render( :partial => '/tokens/token',
+ :object => @token,
+ :locals => { :resource_owner => @resource_owner } )
View
4 app/views/confidential_clients/tokens/create.notator
@@ -1 +1,3 @@
-json << render( :partial => '/tokens/token', :object => @token )
+json << render( :partial => '/tokens/token',
+ :object => @token,
+ :locals => { :resource_owner => @resource_owner } )
View
4 app/views/public_clients/registrations/new.html.erb
@@ -1,4 +1,4 @@
-<h2> User Sign up </h2>
+<h2> Register </h2>
<% @resource_owner.errors.each do | attribute, value | %>
- <%= attribute %> : <%= value %><br/>
<% end %>
@@ -23,6 +23,6 @@
<% end %>
- <p> <%= submit_tag "Create" %></p>
+ <p> <%= submit_tag "Register" %></p>
<% end %>
View
4 app/views/public_clients/tokens/create.notator
@@ -1 +1,3 @@
-json << render( :partial => '/tokens/token', :object => @token )
+json << render( :partial => '/tokens/token',
+ :object => @token,
+ :locals => { :resource_owner => @resource_owner } )
View
2  app/views/resource_owners/_resource_owner.notator
@@ -0,0 +1,2 @@
+json.id resource_owner.id
+json.name resource_owner.credentials[ :username ].username
View
6 app/views/tokens/_token.notator
@@ -1,3 +1,7 @@
json.access_token token.id
json.token_type 'bearer'
-json.expires_in ( token.expires_on.to_i - DateTime.now.to_i ) unless token.expires_on.nil?
+json.expires_in ( token.expires_on.to_i - DateTime.now.to_i ) unless token.expires_on.nil?
+
+json.resource_owner do
+ json << ( render :partial => '/resource_owners/resource_owner', :object => resource_owner )
+end
View
2  lib/controller/filters/client.rb
@@ -54,7 +54,7 @@ def before( controller )
# if so ...
# attempt to find the client with the given id
- client = ::Client.find( client_id ) #rescue nil
+ client = ::Client.find( client_id ) rescue nil
# was a client found?
unless client.nil?

No commit comments for this range

Something went wrong with that request. Please try again.