(state: string)
| 18 | }; |
| 19 | |
| 20 | const createAuthorizeUrl = (state: string) => { |
| 21 | const parameters = Object.entries({ |
| 22 | state, |
| 23 | scope: 'read_api', |
| 24 | response_type: 'code', |
| 25 | client_id: CLIENT_ID, |
| 26 | redirect_uri: AUTH_REDIRECT_URI, |
| 27 | }).map(([key, value]) => `${key}=${encodeURIComponent(value)}`); |
| 28 | return `${GITLAB_ORIGIN}/oauth/authorize?${parameters.join('&')}`; |
| 29 | }; |
| 30 | |
| 31 | // https://docs.gitlab.com/ee/api/oauth2.html#authorization-code-flow |
| 32 | export const ConnectToGitLab = async () => { |