Merge branch 'v13/dev' into contrib

# Conflicts:
#	src/Umbraco.Cms.StaticAssets/umbraco/UmbracoBackOffice/Default.cshtml
#	src/Umbraco.Core/EmbeddedResources/Lang/en.xml
#	src/Umbraco.Web.UI.Client/src/common/services/blockeditormodelobject.service.js
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Login/login.spec.ts
This commit is contained in:
Sebastiaan Janssen
2024-01-02 10:33:35 +01:00
54 changed files with 776 additions and 231 deletions

View File

@@ -282,6 +282,22 @@ function dependencies() {
],
"base": "./node_modules/wicg-inert"
},
{
"name": "umbraco-ui",
"src": [
"./node_modules/@umbraco-ui/uui/dist/uui.min.js",
"./node_modules/@umbraco-ui/uui/dist/uui.min.js.map",
"./node_modules/@umbraco-ui/uui-css/dist/custom-properties.css",
"./node_modules/@umbraco-ui/uui-css/dist/uui-text.css",
"./node_modules/@umbraco-ui/uui-css/dist/uui-css.css",
"./node_modules/@umbraco-ui/uui-css/assets/fonts/lato/LatoLatin-Black.woff2",
"./node_modules/@umbraco-ui/uui-css/assets/fonts/lato/LatoLatin-Light.woff2",
"./node_modules/@umbraco-ui/uui-css/assets/fonts/lato/LatoLatin-Regular.woff2",
"./node_modules/@umbraco-ui/uui-css/assets/fonts/lato/LatoLatin-Italic.woff2",
"./node_modules/@umbraco-ui/uui-css/assets/fonts/lato/LatoLatin-Bold.woff2"
],
"base": "./node_modules/@umbraco-ui"
},
];
// add streams for node modules

View File

@@ -28,7 +28,7 @@ function authResource($q, $http, umbRequestHelper, angularHelper) {
* });
* </pre>
* @returns {Promise} resourcePromise object
*
*
*/
get2FAProviders: function () {
@@ -203,7 +203,7 @@ function authResource($q, $http, umbRequestHelper, angularHelper) {
"PostRequestPasswordReset"), {
email: email
}),
'Request password reset failed for email ' + email);
'An email with password reset instructions will be sent to the specified address if it matched our records');
},
/**

View File

@@ -398,9 +398,9 @@ When building a custom infinite editor view you can use the same components as a
* @returns {object} editor object
*/
function contentTypePicker(editor) {
if (!editor.entityType) editor.entityType = "documentType";
switch (editor.entityType) {
case "documentType":
documentTypePicker(editor);

View File

@@ -1,6 +1,6 @@
<div ng-controller="Umbraco.Login2faController as vm" class="umb-login-container">
<div ng-controller="Umbraco.Login2faController as cvm" class="umb-login-container">
<div id="twoFactorlogin" ng-cloak="">
<form name="vm.authForm" method="POST" ng-submit="vm.validate()">
<form name="cvm.authForm" method="POST" ng-submit="cvm.validate()">
<header class="h4">
<localize key="login_2fatitle">One last step</localize>
</header>
@@ -12,19 +12,19 @@
<br>
<!-- if there's only one provider active, it will skip this step! -->
<umb-control-group ng-if="vm.providers.length > 1" label="@login_2faMultipleText" label-for="provider" alias="2faprovider">
<select id="2faprovider" name="provider" ng-model="vm.provider">
<option ng-repeat="provider in vm.providers" ng-value="provider">{{provider}}</option>
<umb-control-group ng-if="cvm.providers.length > 1" label="@login_2faMultipleText" label-for="provider" alias="2faprovider">
<select id="2faprovider" name="provider" ng-model="cvm.provider">
<option ng-repeat="provider in cvm.providers" ng-value="provider">{{provider}}</option>
</select>
</umb-control-group>
<umb-control-group label-for="token" alias="2facode" label="@login_2faCodeInput" description="@user_2faDisableText" required="true">
<input type="text" id="2facode" class="-full-width-input input-xlarge" name="token"
inputmode="numeric" autocomplete="one-time-code" ng-model="vm.code" localize="placeholder"
inputmode="numeric" autocomplete="one-time-code" ng-model="cvm.code" localize="placeholder"
placeholder="@login_2faCodeInputHelp" aria-required="true" required umb-auto-focus no-dirty-check />
<div ng-messages="vm.authForm.token.$error" role="alert">
<div ng-messages="cvm.authForm.token.$error" role="alert">
<span class="umb-validation-label" ng-message="token">
<localize key="login_2faInvalidCode">Invalid code entered</localize>
</span>
@@ -37,14 +37,14 @@
button-style="success"
size="m"
label-key="general_validate"
state="vm.stateValidateButton"
disabled="vm.code.length === 0">
state="cvm.stateValidateButton"
disabled="cvm.code.length === 0">
</umb-button>
<umb-button
type="button"
size="m"
label-key="general_back"
action="vm.goBack()">
action="cvm.goBack()">
</umb-button>
</div>
</form>

View File

@@ -11,11 +11,12 @@ angular.module('umbraco').controller("Umbraco.LoginController", function (events
//check if there's a returnPath query string, if so redirect to it
var locationObj = $location.search();
if (locationObj.returnPath) {
// decodeURIComponent(...) does not play nice with OAuth redirect URLs, so until we have a
// dedicated login screen for the new back-office, we need to hardcode this exception
path = locationObj.returnPath.indexOf("/security/back-office/authorize") > 0
? locationObj.returnPath
: decodeURIComponent(locationObj.returnPath);
// ensure that the returnPath is a valid URL under the current origin (prevents DOM-XSS among other things)
const returnPath = decodeURIComponent(locationObj.returnPath);
const url = new URL(returnPath, window.location.origin);
if (url.origin === window.location.origin) {
path = returnPath;
}
}
// Ensure path is not absolute