@@ -0,0 +1,657 @@
+package utils;%0A%0Aimport controllers.OAuth2;%0Aimport models.User;%0A%0Aimport static play.mvc.Controller.session;%0A%0Apublic class Authorization %7B%0A%0A    public static User authorizeUserSession() %7B%0A%0A        if(session().containsKey(%22id%22) && session().containsKey(%22expires%22)) %7B%0A%0A            long expire = Long.parseLong(session().get(%22expires%22));%0A            long now = System.currentTimeMillis();%0A%0A            long secondsLeft = (expire - now) / 1000;%0A%0A            if (secondsLeft %3C 0) %7B%0A%0A                OAuth2.destroySessions();%0A                return null;%0A            %7D%0A%0A            return User.findById(session().get(%22id%22));%0A        %7D%0A        return null;%0A    %7D%0A%7D%0A

Create Authorization.java