Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RocketChat
Rocket.Chat
Commits
b14954ab
Commit
b14954ab
authored
9 years ago
by
Rodrigo Nascimento
Browse files
Options
Downloads
Patches
Plain Diff
Close #861; Fix Gitlab oAuth url from API_Gitlab_URL
parent
0d8bf597
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/rocketchat-custom-oauth/custom_oauth_client.coffee
+10
-7
10 additions, 7 deletions
packages/rocketchat-custom-oauth/custom_oauth_client.coffee
packages/rocketchat-gitlab/common.coffee
+5
-2
5 additions, 2 deletions
packages/rocketchat-gitlab/common.coffee
with
15 additions
and
9 deletions
packages/rocketchat-custom-oauth/custom_oauth_client.coffee
+
10
−
7
View file @
b14954ab
...
...
@@ -8,6 +8,13 @@ class CustomOAuth
if
not
Match
.
test
@
name
,
String
return
throw
new
Meteor
.
Error
'CustomOAuth: Name is required and must be String'
@
configure
options
Accounts
.
oauth
.
registerService
@
name
@
configureLogin
()
configure
:
(
options
)
->
if
not
Match
.
test
options
,
Object
return
throw
new
Meteor
.
Error
'CustomOAuth: Options is required and must be Object'
...
...
@@ -20,13 +27,9 @@ class CustomOAuth
@
serverURL
=
options
.
serverURL
if
not
/^https?:\/\/.+/
.
test
options
.
authorizePath
options
.
authorizePath
=
@
serverURL
+
options
.
authorizePath
@
authorizePath
=
options
.
authorizePath
Accounts
.
oauth
.
registerService
@
name
@
configureLogin
()
@
authorizePath
=
@
serverURL
+
options
.
authorizePath
else
@
authorizePath
=
options
.
authorizePath
configureLogin
:
->
self
=
@
...
...
This diff is collapsed.
Click to expand it.
packages/rocketchat-gitlab/common.coffee
+
5
−
2
View file @
b14954ab
Gitlab
=
new
CustomOAuth
'gitlab'
,
config
=
serverURL
:
'https://gitlab.com'
identityPath
:
'/api/v3/user'
addAutopublishFields
:
forLoggedInUser
:
[
'services.gitlab'
]
forOtherUsers
:
[
'services.gitlab.username'
]
Gitlab
=
new
CustomOAuth
'gitlab'
,
config
Meteor
.
startup
->
Tracker
.
autorun
->
if
RocketChat
.
settings
.
get
'API_Gitlab_URL'
Gitlab
.
serverURL
=
RocketChat
.
settings
.
get
'API_Gitlab_URL'
config
.
serverURL
=
RocketChat
.
settings
.
get
'API_Gitlab_URL'
Gitlab
.
configure
config
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment