Skip to content
Snippets Groups Projects
Commit d64489e6 authored by michael.minelli's avatar michael.minelli
Browse files

Config => Add gitlab token url

parent ac65b7b9
Branches
No related tags found
No related merge requests found
......@@ -12,7 +12,7 @@ class SharedConfig {
client: {
id: string
}, url: {
redirect: string
redirect: string, token: string
}
}
};
......@@ -24,15 +24,18 @@ class SharedConfig {
this.logsFolder = process.env.LOGS_FOLDER || '';
this.gitlab = {
URL: process.env.GITLAB_URL || '', apiURL: process.env.GITLAB_API_URL || ''
URL : process.env.GITLAB_URL || '',
apiURL: process.env.GITLAB_API_URL || ''
};
this.login = {
gitlab: {
client: {
id: process.env.LOGIN_GITLAB_CLIENT_ID || ''
}, url: {
redirect: process.env.LOGIN_GITLAB_URL_REDIRECT || ''
},
url : {
redirect: process.env.LOGIN_GITLAB_URL_REDIRECT || '',
token : process.env.LOGIN_GITLAB_URL_TOKEN || ''
}
}
};
......
......@@ -11,7 +11,7 @@ class GitlabManager {
}
async getTokens(codeOrRefresh: string, isRefresh: boolean = false, clientSecret: string = ''): Promise<GitlabToken> {
const response = await axios.post<GitlabToken>(`${ SharedConfig.gitlab.URL }/oauth/token`, {
const response = await axios.post<GitlabToken>(SharedConfig.login.gitlab.url.token, {
client_id : SharedConfig.login.gitlab.client.id,
client_secret: clientSecret,
grant_type : isRefresh ? 'refresh_token' : 'authorization_code',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment