|
16 | 16 | {{ end }} |
17 | 17 | <h3>{{ call .T "Migrate an existing user" }}</h3> |
18 | 18 |
|
19 | | - <p>{{ call .T "You can link this identity provider to an existing %s account." }} <span class="warning-message">{{ call .T "If you do so, you will no longer be able to log in using your %s password. You'll need to use your Minecraft Token to log in to Minecraft launchers." }}</span></p> |
| 19 | + <p>{{ call .T "You can link this identity provider to an existing %s account." .App.Config.ApplicationName }} <span class="warning-message">{{ call .T "If you do so, you will no longer be able to log in using your %s password. You'll need to use your Minecraft Token to log in to Minecraft launchers." .App.Config.ApplicationName }}</span></p> |
20 | 20 |
|
21 | 21 | <form action="{{ .App.FrontEndURL }}/web/oidc-migrate" method="post"> |
22 | 22 | <input type="text" name="username" placeholder="{{ call .T "Username" }}" required /> |
|
29 | 29 | /> |
30 | 30 | <input type="submit" value="{{ call .T "Link account" }}" /> |
31 | 31 | </form> |
32 | | - {{ $dividerNeeded := true }} |
| 32 | + {{ $dividerNeeded = true }} |
33 | 33 | {{ end }} |
34 | 34 |
|
35 | 35 | <!-- CreateNewPlayer --> |
|
39 | 39 | {{ $dividerNeeded = false }} |
40 | 40 | {{ end }} |
41 | 41 | <h3>{{ call .T "Create a player" }}</h3> |
42 | | - <p>{{ call .T "Complete registration by creating a new player:" }}</p> |
43 | | - <form action="{{ .App.FrontEndURL }}/web/register" method="post"> |
44 | | - <input |
45 | | - required |
46 | | - type="text" |
47 | | - name="playerName" |
48 | | - placeholder="{{ call .T "Player name" }}" |
49 | | - maxlength="{{ .App.Constants.MaxUsernameLength }}" |
50 | | - value="{{ .PreferredPlayerName }}" |
51 | | - {{ if not .AllowChoosingPlayerName }} |
52 | | - title="{{ call .T "Choosing a player name is not allowed." }}" |
53 | | - disabled |
| 42 | + {{ if and .OIDCProvider.Config.RequireInvite (not .InviteCode) }} |
| 43 | + <p>{{ call .T "Registration with %s requires an invite." .OIDCProvider.Config.Name }}</p> |
| 44 | + {{ else if and .App.Config.RegistrationExistingPlayer.RequireInvite (not .InviteCode) }} |
| 45 | + <p>{{ call .T "Registration as a new player is invite-only." }}</p> |
| 46 | + {{ else }} |
| 47 | + <p>{{ call .T "Complete registration by creating a new player:" }}</p> |
| 48 | + <form action="{{ .App.FrontEndURL }}/web/register" method="post"> |
| 49 | + <input |
| 50 | + required |
| 51 | + type="text" |
| 52 | + name="playerName" |
| 53 | + placeholder="{{ call .T "Player name" }}" |
| 54 | + maxlength="{{ .App.Constants.MaxUsernameLength }}" |
| 55 | + value="{{ .PreferredPlayerName }}" |
| 56 | + {{ if not .OIDCProvider.Config.AllowChoosingPlayerName }} |
| 57 | + title="{{ call .T "Choosing a player name is not allowed." }}" |
| 58 | + disabled |
| 59 | + {{ end }} |
| 60 | + /> |
| 61 | + <input |
| 62 | + hidden |
| 63 | + type="checkbox" |
| 64 | + name="useIdToken" |
| 65 | + checked |
| 66 | + /> |
| 67 | + {{ if .App.Config.CreateNewPlayer.AllowChoosingUUID }} |
| 68 | + <p> |
| 69 | + <input |
| 70 | + class="long" |
| 71 | + type="text" |
| 72 | + name="uuid" |
| 73 | + placeholder="{{ if eq .App.Config.PlayerUUIDGeneration "offline" }}{{ call .T "Player UUID (leave blank for offline UUID)" }}{{ else }}{{ call .T "Player UUID (leave blank for random)" }}{{ end }}" |
| 74 | + pattern="^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$" |
| 75 | + /> |
| 76 | + </p> |
| 77 | + {{ end }} |
| 78 | + <input type="text" name="inviteCode" value="{{ .InviteCode }}" hidden /> |
| 79 | + <input hidden name="returnUrl" value="{{ .URL }}" /> |
| 80 | + {{ if .InviteCode }} |
| 81 | + <p><em>{{ call .T "Using invite code %s" .InviteCode }}</em></p> |
54 | 82 | {{ end }} |
55 | | - /> |
56 | | - <input |
57 | | - hidden |
58 | | - type="checkbox" |
59 | | - name="useIdToken" |
60 | | - checked |
61 | | - /> |
62 | | - {{ if .App.Config.CreateNewPlayer.AllowChoosingUUID }} |
63 | 83 | <p> |
64 | | - <input |
65 | | - class="long" |
66 | | - type="text" |
67 | | - name="uuid" |
68 | | - placeholder="{{ if eq .App.Config.PlayerUUIDGeneration "offline" }}{{ call .T "Player UUID (leave blank for offline UUID)" }}{{ else }}{{ call .T "Player UUID (leave blank for random)" }}{{ end }}" |
69 | | - pattern="^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$" |
70 | | - /> |
| 84 | + <input type="submit" value="{{ call .T "Register" }}"/> |
71 | 85 | </p> |
72 | | - {{ end }} |
73 | | - <input type="text" name="inviteCode" value="{{ .InviteCode }}" hidden /> |
74 | | - <input hidden name="returnUrl" value="{{ .URL }}" /> |
75 | | - {{ if .InviteCode }} |
76 | | - <p><em>{{ call .T "Using invite code %s" .InviteCode }}</em></p> |
77 | | - {{ end }} |
78 | | - <p> |
79 | | - <input type="submit" value="{{ call .T "Register" }}"/> |
80 | | - </p> |
81 | | - </form> |
| 86 | + </form> |
| 87 | + {{ end }} |
82 | 88 | {{ $dividerNeeded = true }} |
83 | 89 | {{ end }} |
84 | 90 |
|
|
89 | 95 | {{ $dividerNeeded = false }} |
90 | 96 | {{ end }} |
91 | 97 | <h3>{{ call .T "Register from an existing Minecraft player" }}</h3> |
92 | | - {{ if and .App.Config.RegistrationExistingPlayer.RequireInvite (not |
93 | | - .InviteCode) |
94 | | - }} |
| 98 | + {{ if and .OIDCProvider.Config.RequireInvite (not .InviteCode) }} |
| 99 | + <p>{{ call .T "Registration with %s requires an invite." .OIDCProvider.Config.Name }}</p> |
| 100 | + {{ else if and .App.Config.RegistrationExistingPlayer.RequireInvite (not .InviteCode) }} |
95 | 101 | <p>{{ call .T "Registration as an existing player is invite-only." }}</p> |
96 | 102 | {{ else }} |
97 | 103 | {{ if .App.Config.ImportExistingPlayer.RequireSkinVerification }} |
|
111 | 117 | name="playerName" |
112 | 118 | placeholder="{{ call .T "%s player name" .App.Config.ImportExistingPlayer.Nickname }}" |
113 | 119 | maxlength="{{ .App.Constants.MaxUsernameLength }}" |
114 | | - {{ if not .AllowChoosingPlayerName }} |
| 120 | + {{ if not .OIDCProvider.Config.AllowChoosingPlayerName }} |
115 | 121 | value="{{ .PreferredPlayerName }}" |
116 | 122 | title="{{ call .T "Choosing a player name is not allowed." }}" |
117 | 123 | disabled |
|
0 commit comments