Commits

Koen Van der Auwera committed 572bd8e

redirect to dropbox authorization if no session available

  • Participants
  • Parent commits b8f59ea

Comments (0)

Files changed (2)

 
   class Index < R '/'
     def get
-      @last = $store.last
-      @random = $store.random
-      while @random.id == @last.id
-        @random =  $store.random
+      if $store.dropbox_session
+        @last = $store.last
+        @random = $store.random
+        while @random.id == @last.id
+          @random =  $store.random
+        end
+        render :index
+      else
+        redirect "/authorize"
       end
-      render :index
     end
   end
 

File amanda/store.rb

         redis.set(DROPBOX, session.serialize)
       end
       DropboxSession.deserialize(redis.get(DROPBOX))
+    rescue
+      nil
     end
 
     def redis