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
0133d2f1
Commit
0133d2f1
authored
3 years ago
by
Diego Sampaio
Committed by
Pierre Lehnen
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[FIX] OAuth mismatch redirect_uri error (#24450)
parent
5b16b592
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
client/main.ts
+1
-1
1 addition, 1 deletion
client/main.ts
lib/oauthRedirectUri.ts
+17
-0
17 additions, 0 deletions
lib/oauthRedirectUri.ts
server/main.ts
+1
-0
1 addition, 0 deletions
server/main.ts
with
19 additions
and
1 deletion
client/main.ts
+
1
−
1
View file @
0133d2f1
import
'
../ee/client/ecdh
'
;
import
'
./polyfills
'
;
import
'
./lib/oauthRedirectUri
'
;
import
'
.
.
/lib/oauthRedirectUri
'
;
import
'
./lib/meteorCallWrapper
'
;
import
'
./importPackages
'
;
...
...
This diff is collapsed.
Click to expand it.
client/
lib/oauthRedirectUri.ts
→
lib/oauthRedirectUri.ts
+
17
−
0
View file @
0133d2f1
import
{
Meteor
}
from
'
meteor/meteor
'
;
import
{
OAuth
}
from
'
meteor/oauth
'
;
const
{
_redirectUri
}
=
OAuth
;
const
warn
=
(():
((
message
:
unknown
)
=>
void
)
=>
{
if
(
Meteor
.
isServer
)
{
// eslint-disable-next-line @typescript-eslint/no-var-requires
const
{
SystemLogger
}
=
require
(
'
../server/lib/logger/system
'
);
return
(
message
:
unknown
):
void
=>
{
SystemLogger
.
warn
(
message
);
};
}
return
console
.
warn
;
})();
OAuth
.
_redirectUri
=
(
serviceName
:
string
,
config
:
any
,
params
:
unknown
,
absoluteUrlOptions
:
unknown
):
string
=>
{
const
ret
=
_redirectUri
(
serviceName
,
config
,
params
,
absoluteUrlOptions
);
...
...
@@ -9,6 +22,10 @@ OAuth._redirectUri = (serviceName: string, config: any, params: unknown, absolut
// Meteor 2.3 removed ?close from redirect uri so we need to add it back to not break old oauth clients
// https://github.com/meteor/meteor/commit/b5b7306bedc3e8eb241e64efb1e281925aa75dd3#diff-59244f4e0176cb1beed2e287924e97dc7ae2c0cc51494ce121a85d8937d116a5L11
if
(
!
config
?.
loginStyle
&&
!
ret
.
includes
(
'
close
'
))
{
warn
(
`Automatically added ?close to 'redirect_uri' for
${
serviceName
}
, this behavior will be removed in v5.0.0.\n`
+
"
Please update your OAuth config to accept both with and without ?close as the 'redirect_uri'.
"
,
);
return
`
${
ret
+
(
ret
.
includes
(
'
?
'
)
?
'
&
'
:
'
?
'
)}
close`
;
}
...
...
This diff is collapsed.
Click to expand it.
server/main.ts
+
1
−
0
View file @
0133d2f1
import
'
../ee/server/broker
'
;
import
'
../app/settings/server/startup
'
;
import
'
../lib/oauthRedirectUri
'
;
import
'
./lib/logger/startup
'
;
import
'
./importPackages
'
;
import
'
../imports/startup/server
'
;
...
...
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