Commit d68cf3a3 authored by Quxl's avatar Quxl

x

parent 45ec31fe
......@@ -54,7 +54,7 @@ public interface OAuthApi {
default void doOAuthLogin() {
try {
String redirectUrl = this.getOAuthPath();
String redirectUrl = this.getAuthorizationUrl();
HttpServletResponse response = this.getHttpServletResponse();
response.sendRedirect(redirectUrl);
} catch (OAuthApiException e) {
......@@ -64,7 +64,7 @@ public interface OAuthApi {
}
}
default String getOAuthPath() {
default String getAuthorizationUrl() {
try {
OAuthConfig config = this.getOAuthConfig();
AuthenticationRequestBuilder builder = OAuthClientRequest.authorizationLocation(config.getAuthorizeUrl());
......@@ -85,7 +85,7 @@ public interface OAuthApi {
}
}
default void doOAuthCallback() {
default void callback() {
try {
HttpServletRequest request = this.getHttpServletRequest();
HttpSession session = request.getSession();
......@@ -120,7 +120,7 @@ public interface OAuthApi {
}
}
default void doLogout() {
default void removeOAuthToken() {
try {
HttpServletRequest request = this.getHttpServletRequest();
HttpSession session = request.getSession();
......@@ -133,7 +133,7 @@ public interface OAuthApi {
}
}
default void refresh() {
default void refreshOAuthToken() {
try {
HttpServletRequest request = this.getHttpServletRequest();
HttpSession session = request.getSession();
......@@ -187,7 +187,7 @@ public interface OAuthApi {
} catch (OAuthApiException e) {
throw e;
} catch (OAuthProblemException e) {
this.refresh();
this.refreshOAuthToken();
return doPost(url, headers, data);
} catch (Throwable e) {
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