]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/oauth2_verifier.rb
Convert OpenID authentication to generic third party authentication
[rails.git] / app / models / oauth2_verifier.rb
index 94856d0d810769610c7cf06ab548da53eb2f2805..4dcce5588ff8756b451d80cdeeed20918e7dc58c 100644 (file)
@@ -2,9 +2,9 @@ class Oauth2Verifier < OauthToken
   validates_presence_of :user
   attr_accessor :state
 
-  def exchange!(params={})
+  def exchange!(_params = {})
     OauthToken.transaction do
-      token = Oauth2Token.create! :user=>user,:client_application=>client_application, :scope => scope
+      token = Oauth2Token.create! :user => user, :client_application => client_application, :scope => scope
       invalidate!
       token
     end
@@ -27,7 +27,7 @@ class Oauth2Verifier < OauthToken
   protected
 
   def generate_keys
-    self.token = OAuth::Helper.generate_key(20)[0,20]
+    self.token = OAuth::Helper.generate_key(20)[0, 20]
     self.expires_at = 10.minutes.from_now
     self.authorized_at = Time.now
   end