mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
feat: redirect to oauth with js
This commit is contained in:
parent
333898d677
commit
e133c998ac
1 changed files with 8 additions and 3 deletions
|
|
@ -232,9 +232,14 @@ export default class SettingsBar extends React.PureComponent<Props, State> {
|
|||
</h4>
|
||||
{!hasAccessToken && (
|
||||
<a
|
||||
href={`https://github.com/login/oauth/authorize?client_id=${
|
||||
oauth.clientId
|
||||
}&scope=repo&redirect_uri=${encodeURIComponent(window.location.href)}`}
|
||||
href="#"
|
||||
onClick={() => {
|
||||
// use js here to make sure redirect_uri is latest url
|
||||
const url = `https://github.com/login/oauth/authorize?client_id=${
|
||||
oauth.clientId
|
||||
}&scope=repo&redirect_uri=${encodeURIComponent(window.location.href)}`
|
||||
window.location.href = url
|
||||
}}
|
||||
>
|
||||
Create with OAuth
|
||||
</a>
|
||||
|
|
|
|||
Loading…
Reference in a new issue