Skip to content
This repository has been archived by the owner on Apr 28, 2019. It is now read-only.

Commit

Permalink
Actually set Client#client_id when creating a client
Browse files Browse the repository at this point in the history
  • Loading branch information
bodhi committed Aug 3, 2012
1 parent fe32afa commit 4202975
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rack/oauth2/models.rb
Expand Up @@ -13,8 +13,8 @@ def new_instance(klass, fields)
end

# Long, random and hexy.
def secure_random
OpenSSL::Random.random_bytes(32).unpack("H*")[0]
def secure_random bytes = 32
OpenSSL::Random.random_bytes(bytes).unpack("H*")[0]
end

# A ::DB object.
Expand Down
1 change: 1 addition & 0 deletions lib/rack/oauth2/models/active_record/client.rb
Expand Up @@ -32,6 +32,7 @@ def create(args)
:revoked=>nil }

fields[:secret] = Server.secure_random
fields[:client_id] = Server.secure_random 4

create! fields
end
Expand Down

0 comments on commit 4202975

Please sign in to comment.