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
760ab4be
Unverified
Commit
760ab4be
authored
10 months ago
by
Pierre Lehnen
Committed by
GitHub
10 months ago
Browse files
Options
Downloads
Patches
Plain Diff
fix: CAS user merge not working (#32444)
parent
fa55c49a
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
.changeset/cuddly-owls-join.md
+5
-0
5 additions, 0 deletions
.changeset/cuddly-owls-join.md
apps/meteor/server/lib/cas/findExistingCASUser.ts
+1
-1
1 addition, 1 deletion
apps/meteor/server/lib/cas/findExistingCASUser.ts
with
6 additions
and
1 deletion
.changeset/cuddly-owls-join.md
0 → 100644
+
5
−
0
View file @
760ab4be
---
'
@rocket.chat/meteor'
:
patch
---
Fixed an issue that prevented CAS users from being merged with existing user data on login
This diff is collapsed.
Click to expand it.
apps/meteor/server/lib/cas/findExistingCASUser.ts
+
1
−
1
View file @
760ab4be
...
@@ -18,7 +18,7 @@ export const findExistingCASUser = async (username: string): Promise<IUser | und
...
@@ -18,7 +18,7 @@ export const findExistingCASUser = async (username: string): Promise<IUser | und
// It'll also allow non-CAS users to switch to CAS based login
// It'll also allow non-CAS users to switch to CAS based login
// #TODO: Remove regex based search
// #TODO: Remove regex based search
const
regex
=
new
RegExp
(
`^
${
username
}
$`
,
'
i
'
);
const
regex
=
new
RegExp
(
`^
${
username
}
$`
,
'
i
'
);
const
user
=
await
Users
.
findOne
({
regex
});
const
user
=
await
Users
.
findOne
({
username
:
regex
});
if
(
user
)
{
if
(
user
)
{
// Update the user's external_id to reflect this new username.
// Update the user's external_id to reflect this new username.
await
Users
.
updateOne
({
_id
:
user
.
_id
},
{
$set
:
{
'
services.cas.external_id
'
:
username
}
});
await
Users
.
updateOne
({
_id
:
user
.
_id
},
{
$set
:
{
'
services.cas.external_id
'
:
username
}
});
...
...
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