Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Greenlight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arbeitsgruppe Hardwarenahe IT-Systeme
Greenlight
Commits
4959c1ba
Unverified
Commit
4959c1ba
authored
3 years ago
by
Ahmad Farhat
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added env variable needed when switching social_uids (#3393)
parent
84463974
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/controllers/concerns/authenticator.rb
+2
-0
2 additions, 0 deletions
app/controllers/concerns/authenticator.rb
app/controllers/sessions_controller.rb
+4
-1
4 additions, 1 deletion
app/controllers/sessions_controller.rb
config/application.rb
+2
-0
2 additions, 0 deletions
config/application.rb
with
8 additions
and
1 deletion
app/controllers/concerns/authenticator.rb
+
2
−
0
View file @
4959c1ba
...
...
@@ -85,6 +85,8 @@ module Authenticator
# Check if the user exists under the same email with no social uid and that social accounts are allowed
def
auth_changed_to_social?
(
email
)
return
true
if
Rails
.
configuration
.
social_switching
Rails
.
configuration
.
loadbalanced_configuration
&&
User
.
exists?
(
email:
email
,
provider:
@user_domain
)
&&
!
allow_greenlight_accounts?
...
...
This diff is collapsed.
Click to expand it.
app/controllers/sessions_controller.rb
+
4
−
1
View file @
4959c1ba
...
...
@@ -266,7 +266,10 @@ flash: { alert: I18n.t("registration.insecure_password") } unless User.secure_pa
# Set the user's social id to the new id being passed
def
switch_account_to_social
user
=
User
.
find_by
(
email:
@auth
[
'info'
][
'email'
],
provider:
@user_domain
)
user
=
User
.
find_by
({
email:
@auth
[
'info'
][
'email'
],
provider:
Rails
.
configuration
.
loadbalanced_configuration
?
@user_domain
:
nil
}.
compact
)
logger
.
info
"Switching social account for
#{
user
.
uid
}
"
...
...
This diff is collapsed.
Click to expand it.
config/application.rb
+
2
−
0
View file @
4959c1ba
...
...
@@ -186,5 +186,7 @@ module Greenlight
# Max avatar image size
config
.
max_avatar_size
=
ENV
[
'MAX_AVATAR_SIZE'
].
to_i
.
zero?
?
100_000
:
ENV
[
'MAX_AVATAR_SIZE'
].
to_i
config
.
social_switching
=
ENV
[
'SOCIAL_SWITCHING'
]
==
"true"
end
end
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