mirror of
https://github.com/unmojang/drasl.git
synced 2025-08-03 02:46:03 -04:00
fix: AllowChoosingUUID belongs under CreateNewPlayer, not RegistrationNewPlayer
This commit is contained in:
parent
e82e6f7117
commit
415bff18c0
@ -208,7 +208,7 @@ func TestFront(t *testing.T) {
|
||||
|
||||
config := testConfig()
|
||||
config.AllowAddingDeletingPlayers = true
|
||||
config.RegistrationNewPlayer.AllowChoosingUUID = true
|
||||
config.CreateNewPlayer.AllowChoosingUUID = true
|
||||
ts.Setup(config)
|
||||
defer ts.Teardown()
|
||||
|
||||
@ -468,7 +468,7 @@ func (ts *TestSuite) testRegistrationNewPlayerChosenUUIDNotAllowed(t *testing.T)
|
||||
|
||||
uuid := "11111111-2222-3333-4444-555555555555"
|
||||
|
||||
ts.App.Config.RegistrationNewPlayer.AllowChoosingUUID = false
|
||||
ts.App.Config.CreateNewPlayer.AllowChoosingUUID = false
|
||||
|
||||
returnURL := ts.App.FrontEndURL + "/web/registration"
|
||||
form := url.Values{}
|
||||
|
@ -150,7 +150,7 @@ func (app *App) CreatePlayer(
|
||||
if chosenUUID == nil {
|
||||
playerUUID = uuid.New().String()
|
||||
} else {
|
||||
if !app.Config.RegistrationNewPlayer.AllowChoosingUUID && !callerIsAdmin {
|
||||
if !app.Config.CreateNewPlayer.AllowChoosingUUID && !callerIsAdmin {
|
||||
return Player{}, NewBadRequestUserError("Choosing a UUID is not allowed.")
|
||||
}
|
||||
chosenUUIDStruct, err := uuid.Parse(*chosenUUID)
|
||||
|
2
user.go
2
user.go
@ -191,7 +191,7 @@ func (app *App) CreateUser(
|
||||
if chosenUUID == nil {
|
||||
playerUUID = uuid.New().String()
|
||||
} else {
|
||||
if !app.Config.RegistrationNewPlayer.AllowChoosingUUID && !callerIsAdmin {
|
||||
if !app.Config.CreateNewPlayer.AllowChoosingUUID && !callerIsAdmin {
|
||||
return User{}, NewBadRequestUserError("Choosing a UUID is not allowed.")
|
||||
}
|
||||
chosenUUIDStruct, err := uuid.Parse(*chosenUUID)
|
||||
|
@ -38,7 +38,7 @@
|
||||
{{ if and .App.Config.RegistrationNewPlayer.RequireInvite (not .InviteCode) }}
|
||||
<p>Registration as a new player is invite-only.</p>
|
||||
{{ else }}
|
||||
{{ if .App.Config.RegistrationNewPlayer.AllowChoosingUUID }}
|
||||
{{ if .App.Config.CreateNewPlayer.AllowChoosingUUID }}
|
||||
<p>Register a new account:</p>
|
||||
{{ else }}
|
||||
<p>Register a new account with a random UUID:</p>
|
||||
@ -65,7 +65,7 @@
|
||||
class="long"
|
||||
required
|
||||
/>
|
||||
{{ if .App.Config.RegistrationNewPlayer.AllowChoosingUUID }}
|
||||
{{ if .App.Config.CreateNewPlayer.AllowChoosingUUID }}
|
||||
<p>
|
||||
<input
|
||||
class="long"
|
||||
|
@ -108,7 +108,7 @@
|
||||
maxlength="{{ .App.Constants.MaxPlayerNameLength }}"
|
||||
required
|
||||
/>
|
||||
{{ if or .User.IsAdmin .App.Config.RegistrationNewPlayer.AllowChoosingUUID }}
|
||||
{{ if or .User.IsAdmin .App.Config.CreateNewPlayer.AllowChoosingUUID }}
|
||||
<input
|
||||
class="long"
|
||||
type="text"
|
||||
|
Loading…
x
Reference in New Issue
Block a user