diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php index af43f2d4c4ac5..5fb914abf7b0e 100644 --- a/core/Controller/LoginController.php +++ b/core/Controller/LoginController.php @@ -64,6 +64,7 @@ class LoginController extends Controller { public const LOGIN_MSG_INVALIDPASSWORD = 'invalidpassword'; public const LOGIN_MSG_USERDISABLED = 'userdisabled'; + public const LOGIN_MSG_CSRFCHECKFAILED = 'csrfCheckFailed'; public function __construct( ?string $appName, @@ -291,7 +292,7 @@ public function tryLogin(Chain $loginChain, $user, $user, $redirect_url, - $this->l10n->t('Please try again') + self::LOGIN_MSG_CSRFCHECKFAILED ); } diff --git a/core/src/components/login/LoginForm.vue b/core/src/components/login/LoginForm.vue index 7841edc507440..9a8689dc9cc6e 100644 --- a/core/src/components/login/LoginForm.vue +++ b/core/src/components/login/LoginForm.vue @@ -32,6 +32,11 @@ type="warning"> {{ t('core', 'Please contact your administrator.') }} + + {{ t('core', 'Please try again.') }} +
@@ -184,6 +189,9 @@ export default { apacheAuthFailed() { return this.errors.indexOf('apacheAuthFailed') !== -1 }, + csrfCheckFailed() { + return this.errors.indexOf('csrfCheckFailed') !== -1 + }, internalException() { return this.errors.indexOf('internalexception') !== -1 }, diff --git a/dist/core-login.js b/dist/core-login.js index a8f1212cff1d4..50430c58c1259 100644 --- a/dist/core-login.js +++ b/dist/core-login.js @@ -1,3 +1,3 @@ /*! For license information please see core-login.js.LICENSE.txt */ -!function(){var e,r,i,o={32313:function(e,r,i){"use strict";var o={};i.r(o),i.d(o,{exclude:function(){return qt},extract:function(){return Bt},parse:function(){return Ut},parseUrl:function(){return Dt},pick:function(){return zt},stringify:function(){return Mt},stringifyUrl:function(){return $t}});var s=i(20144),a=i(69183),u=i(59050),c=i(19755),l=i.n(c),f=i(64024),d=i(25108),h={updatableNotification:null,getDefaultNotificationFunction:null,setDefault:function(t){this.getDefaultNotificationFunction=t},hide:function(t,e){u.default.isFunction(t)&&(e=t,t=void 0),t?(t.each((function(){l()(this)[0].toastify?l()(this)[0].toastify.hideToast():d.error("cannot hide toast because object is not set"),this===this.updatableNotification&&(this.updatableNotification=null)})),e&&e.call(),this.getDefaultNotificationFunction&&this.getDefaultNotificationFunction()):d.error("Missing argument $row in OC.Notification.hide() call, caller needs to be adjusted to only dismiss its own notification")},showHtml:function(t,e){(e=e||{}).isHTML=!0,e.timeout=e.timeout?e.timeout:f.Rl;var n=(0,f.PV)(t,e);return n.toastElement.toastify=n,l()(n.toastElement)},show:function(t,e){(e=e||{}).timeout=e.timeout?e.timeout:f.Rl;var n=(0,f.PV)(function(t){return t.toString().split("&").join("&").split("<").join("<").split(">").join(">").split('"').join(""").split("'").join("'")}(t),e);return n.toastElement.toastify=n,l()(n.toastElement)},showUpdate:function(t){return this.updatableNotification&&this.updatableNotification.hideToast(),this.updatableNotification=(0,f.PV)(t,{timeout:f.Rl}),this.updatableNotification.toastElement.toastify=this.updatableNotification,l()(this.updatableNotification.toastElement)},showTemporary:function(t,e){(e=e||{}).timeout=e.timeout||f.TN;var n=(0,f.PV)(t,e);return n.toastElement.toastify=n,l()(n.toastElement)},isHidden:function(){return!l()("#content").find(".toastify").length}},p=u.default.throttle((function(){h.showTemporary(t("core","Connection to server lost"))}),7e3,{trailing:!1}),m={enableDynamicSlideToggle:function(){},showAppSidebar:function(t){(t||l()("#app-sidebar")).removeClass("disappear").show(),l()("#app-content").trigger(new(l().Event)("appresized"))},hideAppSidebar:function(t){(t||l()("#app-sidebar")).hide().addClass("disappear"),l()("#app-content").trigger(new(l().Event)("appresized"))}},g=i(79753);function v(t,e,n){"post"!==t&&"delete"!==t||!bt.PasswordConfirmation.requiresPasswordConfirmation()?(n=n||{},l().ajax({type:t.toUpperCase(),url:(0,g.generateOcsUrl)("apps/provisioning_api/api/v1/config/apps")+e,data:n.data||{},success:n.success,error:n.error})):bt.PasswordConfirmation.requirePasswordConfirmation(_.bind(v,this,t,e,n))}var y=window.oc_appconfig||{},b={getValue:function(t,e,n,r){!function(t,e,n,r){(r=r||{}).data={defaultValue:n},v("get","/"+t+"/"+e,r)}(t,e,n,{success:r})},setValue:function(t,e,n){!function(t,e,n,r){(r=r||{}).data={value:n},v("post","/"+t+"/"+e,r)}(t,e,n)},getApps:function(t){!function(t){v("get","",t)}({success:t})},getKeys:function(t,e){!function(t,e){v("get","/"+t,e)}(t,{success:e})},deleteKey:function(t,e){!function(t,e,n){v("delete","/"+t+"/"+e,void 0)}(t,e)}},w=void 0!==window._oc_appswebroots&&window._oc_appswebroots,x=i(72316),A=i.n(x),C=i(76591),E=i(25108),P={create:"POST",update:"PROPPATCH",patch:"PROPPATCH",delete:"DELETE",read:"PROPFIND"};function j(t,e){if(u.default.isArray(t))return u.default.map(t,(function(t){return j(t,e)}));var n={href:t.href};return u.default.each(t.propStat,(function(t){if("HTTP/1.1 200 OK"===t.status)for(var r in t.properties){var i=r;r in e&&(i=e[r]),n[i]=t.properties[r]}})),n.id||(n.id=k(n.href)),n}function k(t){var e=t.indexOf("?");e>0&&(t=t.substr(0,e));var n,r=t.split("/");do{n=r[r.length-1],r.pop()}while(!n&&r.length>0);return n}function N(t){return t>=200&&t<=299}function O(t,e,n,r){return t.propPatch(e.url,function(t,e){var n,r={};for(n in t){var i=e[n],o=t[n];i||(E.warn('No matching DAV property for property "'+n),i=n),(u.default.isBoolean(o)||u.default.isNumber(o))&&(o=""+o),r[i]=o}return r}(n.changed,e.davProperties),r).then((function(t){N(t.status)?u.default.isFunction(e.success)&&e.success(n.toJSON()):u.default.isFunction(e.error)&&e.error(t)}))}var S=A().noConflict();Object.assign(S,{davCall:function(t,e){var n=new C.dav.Client({baseUrl:t.url,xmlNamespaces:u.default.extend({"DAV:":"d","http://owncloud.org/ns":"oc"},t.xmlNamespaces||{})});n.resolveUrl=function(){return t.url};var r=u.default.extend({"X-Requested-With":"XMLHttpRequest",requesttoken:OC.requestToken},t.headers);return"PROPFIND"===t.type?function(t,e,n,r){return t.propFind(e.url,u.default.values(e.davProperties)||[],e.depth,r).then((function(t){if(N(t.status)){if(u.default.isFunction(e.success)){var n=u.default.invert(e.davProperties),r=j(t.body,n);e.depth>0&&r.shift(),e.success(r)}}else u.default.isFunction(e.error)&&e.error(t)}))}(n,t,0,r):"PROPPATCH"===t.type?O(n,t,e,r):"MKCOL"===t.type?function(t,e,n,r){return t.request(e.type,e.url,r,null).then((function(i){N(i.status)?O(t,e,n,r):u.default.isFunction(e.error)&&e.error(i)}))}(n,t,e,r):function(t,e,n,r){return r["Content-Type"]="application/json",t.request(e.type,e.url,r,e.data).then((function(t){if(N(t.status)){if(u.default.isFunction(e.success)){if("PUT"===e.type||"POST"===e.type||"MKCOL"===e.type){var r=t.body||n.toJSON(),i=t.xhr.getResponseHeader("Content-Location");return"POST"===e.type&&i&&(r.id=k(i)),void e.success(r)}if(207===t.status){var o=u.default.invert(e.davProperties);e.success(j(t.body,o))}else e.success(t.body)}}else u.default.isFunction(e.error)&&e.error(t)}))}(n,t,e,r)},davSync:function(t){return function(e,n,r){var i={type:P[e]||e},o=n instanceof t.Collection;if("update"===e&&(n.hasInnerCollection?i.type="MKCOL":(n.usePUT||n.collection&&n.collection.usePUT)&&(i.type="PUT")),r.url||(i.url=u.default.result(n,"url")||function(){throw new Error('A "url" property or function must be specified')}()),null!=r.data||!n||"create"!==e&&"update"!==e&&"patch"!==e||(i.data=JSON.stringify(r.attrs||n.toJSON(r))),"PROPFIND"!==i.type&&(i.processData=!1),"PROPFIND"===i.type||"PROPPATCH"===i.type){var s=n.davProperties;!s&&n.model&&(s=n.model.prototype.davProperties),s&&(u.default.isFunction(s)?i.davProperties=s.call(n):i.davProperties=s),i.davProperties=u.default.extend(i.davProperties||{},r.davProperties),u.default.isUndefined(r.depth)&&(r.depth=o?1:0)}var a=r.error;r.error=function(t,e,n){r.textStatus=e,r.errorThrown=n,a&&a.call(r.context,t,e,n)};var c=r.xhr=t.davCall(u.default.extend(i,r),n);return n.trigger("request",n,c,r),c}}(S)});var T=S,L=i(65358),I=window._oc_config||{},R=document.getElementsByTagName("head")[0].getAttribute("data-user"),F=document.getElementsByTagName("head")[0].getAttribute("data-user-displayname"),B=void 0!==R&&R,U=i(96384),M=i(62520);function D(t){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},D(t)}var $={YES_NO_BUTTONS:70,OK_BUTTONS:71,FILEPICKER_TYPE_CHOOSE:1,FILEPICKER_TYPE_MOVE:2,FILEPICKER_TYPE_COPY:3,FILEPICKER_TYPE_COPY_MOVE:4,FILEPICKER_TYPE_CUSTOM:5,dialogsCounter:0,alert:function(t,e,n,r){this.message(t,e,"alert",$.OK_BUTTON,n,r)},info:function(t,e,n,r){this.message(t,e,"info",$.OK_BUTTON,n,r)},confirm:function(t,e,n,r){return this.message(t,e,"notice",$.YES_NO_BUTTONS,n,r)},confirmDestructive:function(t,e,n,r,i){return this.message(t,e,"none",n,r,void 0===i||i)},confirmHtml:function(t,e,n,r){return this.message(t,e,"notice",$.YES_NO_BUTTONS,n,r,!0)},prompt:function(e,n,r,i,o,s){return l().when(this._getMessageTemplate()).then((function(a){var c="oc-dialog-"+$.dialogsCounter+"-content",f="#"+c,d=a.octemplate({dialog_name:c,title:n,message:e,type:"notice"}),h=l()("");h.attr("type",s?"password":"text").attr("id",c+"-input").attr("placeholder",o);var p=l()("