mirror of
https://github.com/unmojang/drasl.git
synced 2025-08-03 19:06:04 -04:00
Option to disable auth from FallbackAPIServers
Resolves https://github.com/unmojang/drasl/issues/146
This commit is contained in:
parent
3ed22110b3
commit
9436529e59
@ -54,6 +54,8 @@ Other available options:
|
||||
|
||||
- `DenyUnknownUsers`: Don't allow clients using this authentication server to log in to a Minecraft server using Drasl unless there is a Drasl user with the client's player name. This option effectively allows you to use Drasl as a whitelist for your Minecraft server. You could allow users to authenticate using, for example, Mojang's authentication server, but only if they are also registered on Drasl. Boolean. Default value: `false`.
|
||||
|
||||
- `EnableAuthentication`: Allow Minecraft clients using this authentication server to log in to a Minecraft server using Drasl. Disable this option if you, for example, want to use `ForwardSkins = true` but don't want to allow authentication from the fallback API server. Boolean. Default value: `true`.
|
||||
|
||||
- `OfflineSkins`: Try to resolve skins for "offline" UUIDs. When `online-mode` is set to `false` in `server.properties` (sometimes called "offline mode"), players' UUIDs are computed deterministically from their player names instead of being managed by the authentication server. If this option is enabled and a skin for an unknown UUID is requested, Drasl will search for a matching player by offline UUID. This option is required to see other players' skins on offline servers. Boolean. Default value: `true`.
|
||||
|
||||
<!-- - `[TransientLogin]`: Allow certain usernames to authenticate with a shared password, without registering. Useful for supporting bot accounts. -->
|
||||
|
@ -142,13 +142,16 @@ func (app *App) hasJoined(c *echo.Context, playerName string, serverID string, l
|
||||
}
|
||||
|
||||
if result.Error != nil || !player.ServerID.Valid || serverID != player.ServerID.String {
|
||||
for _, fallbackAPIServer := range app.Config.FallbackAPIServers {
|
||||
if fallbackAPIServer.DenyUnknownUsers && result.Error != nil {
|
||||
for _, fallbackAPIServer := range app.FallbackAPIServers {
|
||||
if !fallbackAPIServer.Config.EnableAuthentication {
|
||||
continue
|
||||
}
|
||||
if fallbackAPIServer.Config.DenyUnknownUsers && result.Error != nil {
|
||||
// If DenyUnknownUsers is enabled and the player name is
|
||||
// not known, don't query the fallback server.
|
||||
continue
|
||||
}
|
||||
base, err := url.Parse(fallbackAPIServer.SessionURL)
|
||||
base, err := url.Parse(fallbackAPIServer.Config.SessionURL)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
continue
|
||||
|
Loading…
x
Reference in New Issue
Block a user