Hi,
i have a situation i want show the maintenance screen when the application is deploying to prod from uat. it should show when user try login and also redirect to the maintenance screen when the user is already logged into application
we are using microsoft oauth to login
Hi @Sai Rajesh Chappa,
Hope you are doing well.
I think you can do this with the help of a site property. Whenever you deploy the application, you can toggle the site property in the target environment and once it is done, you can toggle it back.
Also, if the site property is toggled, make sure that you modify the logics accordingly so that you can keep some data security for that particular period of time.
Thanks & Regards
To implement a maintenance screen during deployment when using Microsoft OAuth for login, here's an approach you can follow:
Since you're using Microsoft OAuth, you should handle the redirection at the entry points of your application. Here's how:
MaintenanceMode
True
To achieve this, you can add logic like this in your layout's Preparation:
If (Site.MaintenanceMode = True) Then RedirectToMaintenancePage() End If
This will ensure that any page loads redirect to the Maintenance screen during deployment.
Even though Microsoft OAuth handles login and token authentication, you can still ensure users are redirected to the Maintenance page after authentication:
Site.MaintenanceMode
To prevent users from carrying out any actions after deployment has started:
Session.UserId = NullIdentifier()
False
By leveraging the MaintenanceMode property, you ensure users are redirected appropriately, regardless of whether they're logged in or not.
For additional guidance or similar scenarios, refer to solutions discussed here: Maintenance Window.