|
|
@ -41,7 +41,9 @@ public class LoginService { |
|
|
|
|
|
|
|
|
|
|
|
public boolean verify(String cookie) throws UndergradRpcException { |
|
|
|
public boolean verify(String cookie) throws UndergradRpcException { |
|
|
|
try { |
|
|
|
try { |
|
|
|
return !undergraduateLogin.checkCookiesFail(cookie); |
|
|
|
return undergraduateLogin.testCookie(cookie); |
|
|
|
|
|
|
|
} catch (ApiException e) { |
|
|
|
|
|
|
|
return false; |
|
|
|
} catch (IOException e) { |
|
|
|
} catch (IOException e) { |
|
|
|
throw new UndergradRpcException( |
|
|
|
throw new UndergradRpcException( |
|
|
|
UndergradRpcException.TypeCode.NETWORK_EXCEPTION, |
|
|
|
UndergradRpcException.TypeCode.NETWORK_EXCEPTION, |
|
|
@ -59,6 +61,7 @@ public class LoginService { |
|
|
|
case UNI_LOGIN_USER_BANNED -> UndergradRpcException.ErrorCode.AUTH_USER_BANNED; |
|
|
|
case UNI_LOGIN_USER_BANNED -> UndergradRpcException.ErrorCode.AUTH_USER_BANNED; |
|
|
|
case UNI_LOGIN_USER_DISABLED -> UndergradRpcException.ErrorCode.AUTH_USER_DISABLED; |
|
|
|
case UNI_LOGIN_USER_DISABLED -> UndergradRpcException.ErrorCode.AUTH_USER_DISABLED; |
|
|
|
case UNI_LOGIN_NEED_CHANGE_PASSWORD -> UndergradRpcException.ErrorCode.AUTH_NEED_CHANGE_PASSWORD; |
|
|
|
case UNI_LOGIN_NEED_CHANGE_PASSWORD -> UndergradRpcException.ErrorCode.AUTH_NEED_CHANGE_PASSWORD; |
|
|
|
|
|
|
|
case UNDERGRAD_BANNED_IN_EXCLUSIVE_TIME -> UndergradRpcException.ErrorCode.AUTH_BANNED_IN_EXCLUSIVE_TIME; |
|
|
|
case UNI_LOGIN_USER_NOT_ONLY -> UndergradRpcException.ErrorCode.AUTH_UNKNOWN_ERROR; |
|
|
|
case UNI_LOGIN_USER_NOT_ONLY -> UndergradRpcException.ErrorCode.AUTH_UNKNOWN_ERROR; |
|
|
|
case UNI_LOGIN_NO_REGISTER -> UndergradRpcException.ErrorCode.AUTH_UNKNOWN_ERROR; |
|
|
|
case UNI_LOGIN_NO_REGISTER -> UndergradRpcException.ErrorCode.AUTH_UNKNOWN_ERROR; |
|
|
|
case UNI_LOGIN_NEED_TFA -> UndergradRpcException.ErrorCode.AUTH_UNKNOWN_ERROR; |
|
|
|
case UNI_LOGIN_NEED_TFA -> UndergradRpcException.ErrorCode.AUTH_UNKNOWN_ERROR; |
|
|
|