File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
components/dashboard/src/settings Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ import { InputWithCopy } from "../components/InputWithCopy";
21
21
import { copyToClipboard } from "../utils" ;
22
22
import TokenEntry from "./TokenEntry" ;
23
23
24
+ const personalAccessTokenNameRegex = / ^ [ a - z A - Z 0 - 9 - _ ] { 3 , 63 } $ / ;
25
+
24
26
function PersonalAccessTokens ( ) {
25
27
const { enablePersonalAccessTokens } = useContext ( FeatureFlagContext ) ;
26
28
@@ -150,6 +152,10 @@ export function PersonalAccessTokenCreateView() {
150
152
if ( change . expirationDays ) {
151
153
change . expirationDate = new Date ( Date . now ( ) + change . expirationDays * 24 * 60 * 60 * 1000 ) ;
152
154
}
155
+ if ( change . name ) {
156
+ if ( ! personalAccessTokenNameRegex . test ( change . name ) ) {
157
+ }
158
+ }
153
159
setErrorMsg ( "" ) ;
154
160
setValue ( { ...value , ...change } ) ;
155
161
} ;
You can’t perform that action at this time.
0 commit comments