When using New-UDApp with -PageNotFound the default page "reset-password" is not working anymore
Hi,
when i am using `PageNotFound` and `NotAuthorized` parameter for `New-UDApp` i cannot view the "reset-password" page when i run an app on "/" as `BaseUrl`.
When the password of PSU Admin acccount or other local accounts expires, the scriptblock in PageNotFound will be triggered and in my use case i will be redirected to a custom page.
I do not know if this is also the same for other integrated urls that are located at "/".
Anyone else have this? Can this please be reproduced/fixed?
Demo code (AI generated, not tested, but parameters and usage are the same as for my use case):
New-PSUApp -Name 'BugReport-ResetPassword' -BaseUrl '/' -Authenticated -Content {
New-UDApp `
-Title 'Bug Report Demo' `
-PageNotFound {
New-UDTypography -Text 'Custom PageNotFound'
} `
-NotAuthorized {
New-UDTypography -Text 'Custom NotAuthorized'
} `
-Content {
New-UDTypography -Text 'Home Page'
}
}
Thanks
René
Hi René,
Thank you for reporting this.
I have not confirmed this behavior yet on my side, but based on your description it sounds like the custom `PageNotFound` handler may be intercepting the built-in `reset-password` route when the app is hosted at `BaseUrl '/'`.
To help us validate and reproduce this accurately, could you please share the following details?
* PowerShell Universal version
* Whether this only happens with `BaseUrl '/'` or also with another base URL, such as `/test`
* Whether the issue happens with only `PageNotFound`, only `NotAuthorized`, or only when both are defined
* A minimal tested script that reproduces the behavior
* Any PSU logs generated when trying to access the reset password page with an expired local account
As an initial workaround, could you also test whether temporarily removing the custom `PageNotFound` block allows the built-in reset password page to load correctly?
Once we have those details, we can try to reproduce the issue and determine whether this needs to be escalated as a routing issue with built-in PSU pages and apps hosted at the root path.
Thanks,
Ruben Tapia
Hi René,
Thank you for reporting this.
I have not confirmed this behavior yet on my side, but based on your description it sounds like the custom `PageNotFound` handler may be intercepting the built-in `reset-password` route when the app is hosted at `BaseUrl '/'`.
To help us validate and reproduce this accurately, could you please share the following details?
* PowerShell Universal version
* Whether this only happens with `BaseUrl '/'` or also with another base URL, such as `/test`
* Whether the issue happens with only `PageNotFound`, only `NotAuthorized`, or only when both are defined
* A minimal tested script that reproduces the behavior
* Any PSU logs generated when trying to access the reset password page with an expired local account
As an initial workaround, could you also test whether temporarily removing the custom `PageNotFound` block allows the built-in reset password page to load correctly?
Once we have those details, we can try to reproduce the issue and determine whether this needs to be escalated as a routing issue with built-in PSU pages and apps hosted at the root path.
Thanks,
Ruben Tapia
@rubentapia
Hi, thanks for the answer. I will do it. We are currently in the release of a new web app (based on psu). i will come back as soon as possible to answer your questions
Hi all, I was able to reproduce this and raised a bug report here. The issue was introduced with PSU version 5.5.0.