diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/options.html | 3 | ||||
-rw-r--r-- | source/options.tsx | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/source/options.html b/source/options.html index df64ccb5..74fb4968 100644 --- a/source/options.html +++ b/source/options.html @@ -19,7 +19,8 @@ <p> Optional, <a id="personal-token-link" href="https://github.com/settings/tokens/new?description=Refined%20GitHub&scopes=repo,delete_repo">generate one</a><br> <!-- placeholder is set to enable use of :placeholder-shown CSS selector --> - <input type="text" name="personalToken" pattern="[\da-f]{40}|ghp_\w{36,251}" placeholder=" " spellcheck="false" autocomplete="off" autocapitalize="off"> + <!-- https://gist.github.com/magnetikonline/073afe7909ffdd6f10ef06a00bc3bc88 --> + <input type="text" name="personalToken" pattern="[\da-f]{40}|ghp_\w{36,251}|github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59}" placeholder=" " spellcheck="false" autocomplete="off" autocapitalize="off"> <span id="validation"></span> </p> <ul> diff --git a/source/options.tsx b/source/options.tsx index 556a5b89..2dae5ae0 100644 --- a/source/options.tsx +++ b/source/options.tsx @@ -95,6 +95,12 @@ async function updateStorageUsage(area: 'sync' | 'local'): Promise<void> { async function validateToken(): Promise<void> { reportStatus({}); const tokenField = select('input[name="personalToken"]')!; + + if (tokenField.value.startsWith('github_pat_')) { + // Validation not supported yet https://github.com/refined-github/refined-github/issues/6092 + return; + } + if (!tokenField.validity.valid || tokenField.value.length === 0) { expandTokenSection(); return; |