Commit 3572d1f8 authored by Quxl's avatar Quxl

x

parent 2c722beb
......@@ -32,10 +32,14 @@ public interface OAuthApi {
final String OAUTH_TOKEN_SESSION = "OAUTH2_TOKEN_SESSION_KEY";
default boolean isLogin() {
return getOAuthToken() != null;
}
default OAuthToken getOAuthToken() {
HttpServletRequest request = this.getHttpServletRequest();
HttpSession session = request.getSession();
OAuthToken token = (OAuthToken)session.getAttribute(OAUTH_TOKEN_SESSION);
return token != null;
return token;
}
default void toLogin() {
......@@ -154,5 +158,5 @@ public interface OAuthApi {
throw new OAuthApiException(e.getMessage(), e);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment