Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(UserPrefRepo): update personal access token format #204

Merged

Conversation

mt-yohei-koyama
Copy link
Contributor

@mt-yohei-koyama mt-yohei-koyama commented Apr 6, 2021

Summary

GitHub changed the format of personal access token and this makes token validation failure.
https://github.blog/2021-04-05-behind-githubs-new-authentication-token-formats/

This PR is for supporting the new GitHub access token format (e.g., ghp_....)

Ref:

Test

Tested the new regex with my revoked tokens

  jasper git:(fix-new-access-token-format) node
Welcome to Node.js v12.14.0.
Type ".help" for more information.
> 'db03ece8f912d2f5215ce24934003cc627b73019'.match(/^(?:[a-f0-9]{40}|ghp_\w{36,251})$/)
[
  'db03ece8f912d2f5215ce24934003cc627b73019',
  index: 0,
  input: 'db03ece8f912d2f5215ce24934003cc627b73019',
  groups: undefined
]
> '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'.match(/^(?:[a-f0-9]{40}|ghp_\w{36,251})$/)
[
  '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',
  index: 0,
  input: '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',
  groups: undefined
]

Confirmed it's working locally as well (npm run mac:run)

@limitusus
Copy link

Workaround until this PR is released for those who deleted old-formatted access token:

  1. Launch Jasper app
  2. Dev→Open Data Directory
  3. Edit config.json (github.accessToken) and relaunch Jasper app.

@h13i32maru h13i32maru merged commit 82b435e into jasperapp:master Apr 25, 2021
@h13i32maru
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants