1. Koen Van der Auwera
  2. amanda

Commits

Koen Van der Auwera  committed 7064a7d

don't authorize when authorized

  • Participants
  • Parent commits 16243f1
  • Branches master

Comments (0)

Files changed (1)

File amanda.rb

View file
 
   class Authorize < R '/authorize'
     def get
-      session = DropboxSession.new(ENV["DROPBOX_APP_KEY"], ENV["DROPBOX_APP_SECRET"])
-      session.get_request_token
-      @state["dropbox"] = session
-      redirect session.get_authorize_url(URL("/authorized").to_s)
+      if $store.dropbox_session
+        redirect "/"
+      else
+        session = DropboxSession.new(ENV["DROPBOX_APP_KEY"], ENV["DROPBOX_APP_SECRET"])
+        session.get_request_token
+        @state["dropbox"] = session
+        redirect session.get_authorize_url(URL("/authorized").to_s)
+      end
     end
   end