← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8593: Added custom header to login page (Login-Page: true). Used for detecting redirect to login page i...

 

------------------------------------------------------------
revno: 8593
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-10-19 11:49:13 +0200
message:
  Added custom header to login page (Login-Page: true). Used for detecting redirect to login page in XHR requests.
modified:
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/action/LoginAction.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/action/LoginAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/action/LoginAction.java	2012-08-10 10:02:21 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/action/LoginAction.java	2012-10-19 09:49:13 +0000
@@ -74,11 +74,14 @@
     public String execute()
     {
         Device device = deviceResolver.resolveDevice( ServletActionContext.getRequest() );
-        
+
+        ServletActionContext.getResponse().addHeader( "Login-Page", "true" );
+
         if ( device.isMobile() )
         {
             return "mobile";
         }
+
         return "standard";
     }
 }