Skip to content
GitLab
Menu
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
10fe5d11
Commit
10fe5d11
authored
May 17, 2022
by
Benjamin Elsdon
Committed by
Melledy
May 17, 2022
Browse files
AuthenticationSystem::verifyUser now returns the user's Account instead of a boolean
parent
cc98c569
Changes
2
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/auth/AuthenticationSystem.java
View file @
10fe5d11
package
emu.grasscutter.auth
;
package
emu.grasscutter.auth
;
import
emu.grasscutter.game.Account
;
import
emu.grasscutter.server.http.objects.*
;
import
emu.grasscutter.server.http.objects.*
;
import
express.http.Request
;
import
express.http.Request
;
import
express.http.Response
;
import
express.http.Response
;
...
@@ -30,10 +31,10 @@ public interface AuthenticationSystem {
...
@@ -30,10 +31,10 @@ public interface AuthenticationSystem {
/**
/**
* Called by plugins to internally verify a user's identity.
* Called by plugins to internally verify a user's identity.
* @param details A unique
, one-time token to verify the user.
* @param details A unique
identifier to identify the user. (For example: a JWT token)
* @return T
rue if the user is verified, False otherwise
.
* @return T
he user's account if the verification was successful, null if the user was unable to be verified
.
*/
*/
boolean
verifyUser
(
String
details
);
Account
verifyUser
(
String
details
);
/**
/**
* This is the authenticator used for password authentication.
* This is the authenticator used for password authentication.
...
...
src/main/java/emu/grasscutter/auth/DefaultAuthentication.java
View file @
10fe5d11
...
@@ -2,6 +2,7 @@ package emu.grasscutter.auth;
...
@@ -2,6 +2,7 @@ package emu.grasscutter.auth;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.auth.DefaultAuthenticators.*
;
import
emu.grasscutter.auth.DefaultAuthenticators.*
;
import
emu.grasscutter.game.Account
;
import
emu.grasscutter.server.http.objects.ComboTokenResJson
;
import
emu.grasscutter.server.http.objects.ComboTokenResJson
;
import
emu.grasscutter.server.http.objects.LoginResultJson
;
import
emu.grasscutter.server.http.objects.LoginResultJson
;
...
@@ -28,9 +29,9 @@ public final class DefaultAuthentication implements AuthenticationSystem {
...
@@ -28,9 +29,9 @@ public final class DefaultAuthentication implements AuthenticationSystem {
}
}
@Override
@Override
public
boolean
verifyUser
(
String
details
)
{
public
Account
verifyUser
(
String
details
)
{
Grasscutter
.
getLogger
().
info
(
translate
(
"dispatch.authentication.default_unable_to_verify"
));
Grasscutter
.
getLogger
().
info
(
translate
(
"dispatch.authentication.default_unable_to_verify"
));
return
false
;
return
null
;
}
}
@Override
@Override
...
...
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