Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,16 @@ public void Configure(BackOfficeExternalLoginProviderOptions options, AzureSsoPr
allowManualLinking: false
)
{
// Optional callback
OnAutoLinking = (autoLoginUser, loginInfo) =>
{
if (!autoLoginUser.IsApproved)
{
SetGroups(autoLoginUser, loginInfo, profileSettings);
SetName(autoLoginUser, loginInfo, profileSettings);
SetEmail(autoLoginUser, loginInfo, profileSettings);
}
},
// Group/name provisioning is handled entirely in OnExternalLogin, which Umbraco
// always calls immediately after OnAutoLinking for a newly linked user - doing it
// here too would run SetGroups/SetName twice on first login (see issue #15).
OnExternalLogin = (user, loginInfo) =>
{
if (profileSettings.SetGroupsOnLogin)
// Not yet approved means this is the first login for a newly auto-linked user,
// so groups must be assigned once here regardless of SetGroupsOnLogin.
var isNewUser = !user.IsApproved;

if (profileSettings.SetGroupsOnLogin || isNewUser)
{
SetGroups(user, loginInfo, profileSettings);
}
Expand Down
Loading