Skip to content

Commit 3fb76c9

Browse files
authored
Create API Token: add regex validation to html input (#4782)
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
1 parent 26167c9 commit 3fb76c9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

bundles/org.openhab.core.io.http.auth/pages/authorize.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
<input class="field" type="{repeatPasswordFieldType}" placeholder="{repeatPasswordPlaceholder}" name="password_repeat" />
115115
</div>
116116
<div>
117-
<input class="field" type="{tokenNameFieldType}" placeholder="{tokenNamePlaceholder}" name="token_name" />
117+
<input class="field" type="{tokenNameFieldType}" placeholder="{tokenNamePlaceholder}" name="token_name" required pattern="[a-zA-Z0-9]+" />
118118
</div>
119119
<div>
120120
<input class="field" type="{tokenScopeFieldType}" placeholder="{tokenScopePlaceholder}" name="token_scope" />

bundles/org.openhab.core.io.http.auth/src/main/resources/messages.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ auth.placeholder.username = User Name
1616
auth.placeholder.password = Password
1717
auth.placeholder.newpassword = New Password
1818
auth.placeholder.repeatpassword = Confirm New Password
19-
auth.placeholder.tokenname = Token Name
19+
auth.placeholder.tokenname = Token Name (alphanumeric)
2020
auth.placeholder.tokenscope = Token Scope (optional)
2121
2222
auth.button.signin = Sign In

0 commit comments

Comments
 (0)