Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
c932f9c7
Commit
c932f9c7
authored
2 years ago
by
Benjamin Elsdon
Committed by
Melledy
2 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Add verifyUser to AuthenticationHandler
parent
9ed1bb9b
development
LintRatchet
stable
v1.4.4
v1.4.3
v1.4.2
v1.4.1
v1.4.0
v1.3.1
v1.3.0
v1.2.2-dev
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/main/java/emu/grasscutter/server/dispatch/authentication/AuthenticationHandler.java
+7
-0
...server/dispatch/authentication/AuthenticationHandler.java
src/main/java/emu/grasscutter/server/dispatch/authentication/DefaultAuthenticationHandler.java
+6
-0
...dispatch/authentication/DefaultAuthenticationHandler.java
src/main/resources/languages/en-US.json
+3
-0
src/main/resources/languages/en-US.json
with
16 additions
and
0 deletions
+16
-0
src/main/java/emu/grasscutter/server/dispatch/authentication/AuthenticationHandler.java
View file @
c932f9c7
...
...
@@ -12,5 +12,12 @@ public interface AuthenticationHandler {
void
handleRegister
(
Request
req
,
Response
res
);
void
handleChangePassword
(
Request
req
,
Response
res
);
/**
* Other plugins may need to verify a user's identity using details from handleLogin()
* @param details The user's unique one-time token that needs to be verified
* @return If the verification was successful
*/
boolean
verifyUser
(
String
details
);
LoginResultJson
handleGameLogin
(
Request
req
,
LoginAccountRequestJson
requestData
);
}
This diff is collapsed.
Click to expand it.
src/main/java/emu/grasscutter/server/dispatch/authentication/DefaultAuthenticationHandler.java
View file @
c932f9c7
...
...
@@ -28,6 +28,12 @@ public class DefaultAuthenticationHandler implements AuthenticationHandler {
res
.
send
(
"Authentication is not available with the default authentication method"
);
}
@Override
public
boolean
verifyUser
(
String
details
)
{
Grasscutter
.
getLogger
().
info
(
translate
(
"dispatch.authentication.default_unable_to_verify"
));
return
false
;
}
@Override
public
LoginResultJson
handleGameLogin
(
Request
req
,
LoginAccountRequestJson
requestData
)
{
LoginResultJson
responseData
=
new
LoginResultJson
();
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/languages/en-US.json
View file @
c932f9c7
...
...
@@ -16,6 +16,9 @@
"no_keystore_error"
:
"[Dispatch] No SSL cert found! Falling back to HTTP server."
,
"default_password"
:
"[Dispatch] The default keystore password was loaded successfully. Please consider setting the password to 123456 in config.json."
},
"authentication"
:
{
"default_unable_to_verify"
:
"[Authentication] Something called the verifyUser method which is unavailable in the default authentication handler"
},
"no_commands_error"
:
"Commands are not supported in dispatch only mode."
,
"unhandled_request_error"
:
"[Dispatch] Potential unhandled %s request: %s"
,
"account"
:
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help