Sorry, there's nothing at this address.
+This component demonstrates fetching data from the server.
+ +@if (forecasts == null) +{ +Loading...
+} +else +{ +| Date | +Temp. (C) | +Temp. (F) | +Summary | +
|---|---|---|---|
| @forecast.Date.ToShortDateString() | +@forecast.TemperatureC | +@forecast.TemperatureF | +@forecast.Summary | +
@(claim.Type): @claim.Value
+} + +@AccessToken?.Value
+ +@(claim.Key): @claim.Value.ToString()
+} + +@if (AccessToken != null) +{ +Current time: @DateTimeOffset.Now
+@AccessToken.Expires
+ +Scope: @scope
+ } +} + +@code { + [CascadingParameter] private Task
+ Request ID: @Model.RequestId
+
+ Swapping to the Development environment displays detailed information about the error that occurred. +
++ The Development environment shouldn't be enabled for deployed applications. + It can result in displaying sensitive information from exceptions to end users. + For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development + and restarting the app. +
diff --git a/src/Components/Blazor/testassets/Wasm.Authentication.Server/Pages/Error.cshtml.cs b/src/Components/Blazor/testassets/Wasm.Authentication.Server/Pages/Error.cshtml.cs new file mode 100644 index 0000000000..7ff93f69eb --- /dev/null +++ b/src/Components/Blazor/testassets/Wasm.Authentication.Server/Pages/Error.cshtml.cs @@ -0,0 +1,27 @@ +using System.Diagnostics; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.Extensions.Logging; + +namespace Wasm.Authentication.Server +{ + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] + public class ErrorModel : PageModel + { + private readonly ILoggerAlternatively, reload
',this.message=this.modal.querySelector("h5"),this.button=this.modal.querySelector("button"),this.reloadParagraph=this.modal.querySelector("p"),this.button.addEventListener("click",function(){return r(s,void 0,void 0,function(){var t;return o(this,function(e){switch(e.label){case 0:this.show(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,window.Blazor.reconnect()];case 2:return e.sent()||this.rejected(),[3,4];case 3:return t=e.sent(),this.logger.log(i.LogLevel.Error,t),this.failed(),[3,4];case 4:return[2]}})})}),this.reloadParagraph.querySelector("a").addEventListener("click",function(){return location.reload()})}return t.prototype.show=function(){this.addedToDom||(this.addedToDom=!0,this.document.body.appendChild(this.modal)),this.modal.style.display="block",this.button.style.display="none",this.reloadParagraph.style.display="none",this.message.textContent="Attempting to reconnect to the server..."},t.prototype.hide=function(){this.modal.style.display="none"},t.prototype.failed=function(){this.button.style.display="block",this.reloadParagraph.style.display="none",this.message.innerHTML="Reconnection failed. Try reloading the page if you're unable to reconnect.",this.message.querySelector("a").addEventListener("click",function(){return location.reload()})},t.prototype.rejected=function(){this.button.style.display="none",this.reloadParagraph.style.display="none",this.message.innerHTML="Could not reconnect to the server. Reload the page to restore functionality.",this.message.querySelector("a").addEventListener("click",function(){return location.reload()})},t}();e.DefaultReconnectDisplay=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.dialog=t}return t.prototype.show=function(){this.removeClasses(),this.dialog.classList.add(t.ShowClassName)},t.prototype.hide=function(){this.removeClasses(),this.dialog.classList.add(t.HideClassName)},t.prototype.failed=function(){this.removeClasses(),this.dialog.classList.add(t.FailedClassName)},t.prototype.rejected=function(){this.removeClasses(),this.dialog.classList.add(t.RejectedClassName)},t.prototype.removeClasses=function(){this.dialog.classList.remove(t.ShowClassName,t.HideClassName,t.FailedClassName,t.RejectedClassName)},t.ShowClassName="components-reconnect-show",t.HideClassName="components-reconnect-hide",t.FailedClassName="components-reconnect-failed",t.RejectedClassName="components-reconnect-rejected",t}();e.UserSpecifiedDisplay=r},function(t,e,n){"use strict";n.r(e);var r,o,i=n(9),s=n(17),a=n(5),c=n(7),u=n(50),l=n(1),h=(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f=function(t){function e(e){var n=t.call(this)||this;return n.logger=e,n}return h(e,t),e.prototype.send=function(t){var e=this;return t.abortSignal&&t.abortSignal.aborted?Promise.reject(new a.a):t.method?t.url?new Promise(function(n,r){var o=new XMLHttpRequest;o.open(t.method,t.url,!0),o.withCredentials=!0,o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.setRequestHeader("Content-Type","text/plain;charset=UTF-8");var i=t.headers;i&&Object.keys(i).forEach(function(t){o.setRequestHeader(t,i[t])}),t.responseType&&(o.responseType=t.responseType),t.abortSignal&&(t.abortSignal.onabort=function(){o.abort(),r(new a.a)}),t.timeout&&(o.timeout=t.timeout),o.onload=function(){t.abortSignal&&(t.abortSignal.onabort=null),o.status>=200&&o.status<300?n(new c.b(o.status,o.statusText,o.response||o.responseText)):r(new a.b(o.statusText,o.status))},o.onerror=function(){e.logger.log(l.a.Warning,"Error from HTTP request. "+o.status+": "+o.statusText+"."),r(new a.b(o.statusText,o.status))},o.ontimeout=function(){e.logger.log(l.a.Warning,"Timeout from HTTP request."),r(new a.c)},o.send(t.content||"")}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))},e}(c.a),p=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),d=function(t){function e(e){var n=t.call(this)||this;return"undefined"!=typeof XMLHttpRequest?n.httpClient=new f(e):n.httpClient=new u.a(e),n}return p(e,t),e.prototype.send=function(t){return t.abortSignal&&t.abortSignal.aborted?Promise.reject(new a.a):t.method?t.url?this.httpClient.send(t):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))},e.prototype.getCookieString=function(t){return this.httpClient.getCookieString(t)},e}(c.a),g=n(51);!function(t){t[t.Invocation=1]="Invocation",t[t.StreamItem=2]="StreamItem",t[t.Completion=3]="Completion",t[t.StreamInvocation=4]="StreamInvocation",t[t.CancelInvocation=5]="CancelInvocation",t[t.Ping=6]="Ping",t[t.Close=7]="Close"}(o||(o={}));var y,v=n(3),b=function(){function t(){this.observers=[]}return t.prototype.next=function(t){for(var e=0,n=this.observers;eAlternatively, reload
',this.message=this.modal.querySelector("h5"),this.button=this.modal.querySelector("button"),this.reloadParagraph=this.modal.querySelector("p"),this.button.addEventListener("click",function(){return r(a,void 0,void 0,function(){var e;return o(this,function(t){switch(t.label){case 0:this.show(),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,window.Blazor.reconnect()];case 2:return t.sent()||this.rejected(),[3,4];case 3:return e=t.sent(),this.logger.log(i.LogLevel.Error,e),this.failed(),[3,4];case 4:return[2]}})})}),this.reloadParagraph.querySelector("a").addEventListener("click",function(){return location.reload()})}return e.prototype.show=function(){this.addedToDom||(this.addedToDom=!0,this.document.body.appendChild(this.modal)),this.modal.style.display="block",this.button.style.display="none",this.reloadParagraph.style.display="none",this.message.textContent="Attempting to reconnect to the server..."},e.prototype.hide=function(){this.modal.style.display="none"},e.prototype.failed=function(){this.button.style.display="block",this.reloadParagraph.style.display="none",this.message.innerHTML="Reconnection failed. Try reloading the page if you're unable to reconnect.",this.message.querySelector("a").addEventListener("click",function(){return location.reload()})},e.prototype.rejected=function(){this.button.style.display="none",this.reloadParagraph.style.display="none",this.message.innerHTML="Could not reconnect to the server. Reload the page to restore functionality.",this.message.querySelector("a").addEventListener("click",function(){return location.reload()})},e}();t.DefaultReconnectDisplay=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.dialog=e}return e.prototype.show=function(){this.removeClasses(),this.dialog.classList.add(e.ShowClassName)},e.prototype.hide=function(){this.removeClasses(),this.dialog.classList.add(e.HideClassName)},e.prototype.failed=function(){this.removeClasses(),this.dialog.classList.add(e.FailedClassName)},e.prototype.rejected=function(){this.removeClasses(),this.dialog.classList.add(e.RejectedClassName)},e.prototype.removeClasses=function(){this.dialog.classList.remove(e.ShowClassName,e.HideClassName,e.FailedClassName,e.RejectedClassName)},e.ShowClassName="components-reconnect-show",e.HideClassName="components-reconnect-hide",e.FailedClassName="components-reconnect-failed",e.RejectedClassName="components-reconnect-rejected",e}();t.UserSpecifiedDisplay=r},function(e,t,n){"use strict";n.r(t);var r=n(6),o=n(12),i=n(2),a=function(){function e(){}return e.write=function(e){var t=e.byteLength||e.length,n=[];do{var r=127&t;(t>>=7)>0&&(r|=128),n.push(r)}while(t>0);t=e.byteLength||e.length;var o=new Uint8Array(n.length+t);return o.set(n,0),o.set(e,n.length),o.buffer},e.parse=function(e){for(var t=[],n=new Uint8Array(e),r=[0,7,14,21,28],o=0;o