26
Views
2
Comments
maintenance screen
Question

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 

2025-04-15 04-00-33
Prakhar Sharma

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

2023-12-26 10-35-28
OutSystems Neo
Staff
AI Generated

To implement a maintenance screen during deployment when using Microsoft OAuth for login, here's an approach you can follow:

1. Maintenance Mode Logic & Redirection

  • First, create a new "Maintenance" page within your application to serve as the maintenance screen.
  • Set up logic in your application to redirect all users (both new and already logged-in users) to the "Maintenance" page during deployment.

2. Configure Redirect Logic

Since you're using Microsoft OAuth, you should handle the redirection at the entry points of your application. Here's how:

  • Utilize session variables or site properties to toggle the app into "Maintenance Mode."
    • Example: Create a MaintenanceMode site property with a boolean value.
  • In the preparation flows of your application (or a global handler like your layout preparation), check the value of the MaintenanceMode property.
    • If MaintenanceMode is True, redirect the user to the "Maintenance" page.

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.

3. Handle OAuth Authentication

Even though Microsoft OAuth handles login and token authentication, you can still ensure users are redirected to the Maintenance page after authentication:

  • Check the Site.MaintenanceMode property in the login flow or at any entry point page.
  • If the application detects maintenance mode after login, perform a follow-up redirection to the "Maintenance" page.

4. User Logout Considerations (Optional)

To prevent users from carrying out any actions after deployment has started:

  • In the "Maintenance" screen preparation or logic, you can call a logout action (e.g., Session.UserId = NullIdentifier()) to clear session details.

Deployment Workflow

  1. Before deployment, toggle Site.MaintenanceMode to True in the production environment via Service Center.
  2. Deploy the updated application from UAT to Prod.
  3. After testing and ensuring the deployment is complete, toggle Site.MaintenanceMode back to 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.

This answer was AI-generated. Please read it carefully and use the forums for clarifications
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.