Skip to content

Commit

Permalink
Fixes a typo in the registration default user name generation script. (
Browse files Browse the repository at this point in the history
…#14826)

* Fixes a typo in the registration default user name generation script.

* Fixes a typo in the login default roles update script.

* Fixed errors in the default login script.

* Add missing new line in login script.

---------

Co-authored-by: Georg von Kries <[email protected]>
  • Loading branch information
gvkries and gvkries authored Dec 7, 2023
1 parent 94167cd commit b89abee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,26 +103,27 @@
var editor = $('#@Html.IdFor(x => x.SyncRolesScript)').data('editor');
if (!keepText) {
editor.doc.setValue(
'/* Uncomment to map AzureAD\n' +
'/* Uncomment to map AzureAd\n' +
'switch (context.loginProvider) {\n' +
' case "AzureAD":\n' +
' case "AzureAd":\n' +
' context.externalClaims.forEach(claim => {\n' +
' if (claim.Type === "http://schemas.microsoft.com/ws/2008/06/identity/claims/role") {\n' +
' switch (claim.Value) {\n' +
' if (claim.type === "http://schemas.microsoft.com/ws/2008/06/identity/claims/role") {\n' +
' switch (claim.value) {\n' +
' case "Writer":\n' +
' context.rolesToAdd.push("Author");\n' +
' break;\n' +
' case "Admin":\n' +
' context.rolesToAdd.push("Administrator");\n' +
' break;\n' +
' default:\n' +
' log("Warning", "Role " + claim.Value + " was not handled");\n' +
' log("Warning", "Role " + claim.value + " was not handled");\n' +
' break;\n' +
' }\n' +
' }\n' +
' });\n' +
' break;\n' +
' default:\n' +
' log("Warning", "Provider " + loginProvider + " was not handled");\n' +
' log("Warning", "Provider " + context.loginProvider + " was not handled");\n' +
' break;\n' +
'}\n' +
'*/\n'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@
var editor = $('#@Html.IdFor(x => x.GenerateUsernameScript)').data('editor');
if (!keepText) {
editor.doc.setValue(
'/* Uncomment to map AzureAD\n' +
'/* Uncomment to map AzureAd\n' +
'// Uncomment to output the context variable in the logs\n' +
'// log("warning", JSON.stringify(context));\n' +
'switch (context.loginProvider) {\n' +
' case "AzureAD":\n' +
' case "AzureAd":\n' +
' context.userName = "azad" + uuid();\n' +
' break;\n' +
' default:\n' +
Expand Down

0 comments on commit b89abee

Please sign in to comment.