Skip to content

Commit

Permalink
Merge pull request #55 from RabotaRu/gitlab-auth-fix
Browse files Browse the repository at this point in the history
Исправлен тип кода ответа для OAuth gitlab
  • Loading branch information
rpiontik authored Jun 1, 2022
2 parents 3116ccf + 640bd27 commit ca91325
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
node_modules
/dist
/certs
/gitlab

/public/workspace/*

Expand Down
2 changes: 1 addition & 1 deletion example.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# URI в формате DocHub корневого манифеста (обязательно)
VUE_APP_DOCHUB_ROOT_MANIFEST=example/root.yaml
VUE_APP_DOCHUB_ROOT_MANIFEST=gitlab:34:main@root.yaml

# Идентификатор документа главной страницы. По умолчанию dochub_welcome
VUE_APP_DOCHUB_ROOT_DOCUMENT=dochub_welcome
Expand Down
4 changes: 2 additions & 2 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let middleware = (route) => {
window.location = new URL(
`/oauth/authorize?client_id=${config.oauth.APP_ID}`
+ `&redirect_uri=` + new URL(consts.pages.OAUTH_CALLBACK_PAGE, window.location)
+ `&response_type=token&state=none&scope=${config.oauth.REQUESTED_SCOPES}`
+ `&response_type=code&state=none&scope=${config.oauth.REQUESTED_SCOPES}`
+ '&' + Math.floor(Math.random() * 10000)
, config.gitlab_server
);
Expand Down Expand Up @@ -138,7 +138,7 @@ if (process.env.VUE_APP_DOCHUB_MODE !== "plugin") {
path: '/sso/gitlab/authentication',
redirect(route) {
const accessToken = Object.keys(route.query).length
? route.query.access_token
? route.query.access_token || route.query.code
: new URLSearchParams(route.hash.substr(1)).get('access_token');
if (accessToken) {
window.Vuex.dispatch('onReceivedOAuthToken', accessToken);
Expand Down

0 comments on commit ca91325

Please sign in to comment.