Done
Pinned fields
Click on the next to a field label to start pinning.
Details
Details
Assignee
Paweł Gesek
Paweł GesekReporter
Nick Reid
Nick Reid(Deactivated)Story Points
5
Original estimate
1w 3d
Time tracking
Components
Sprint
None
Fix versions
Priority
Time Assistant
Time Assistant
Created October 7, 2016 at 8:57 PM
Updated January 20, 2017 at 12:17 PM
Resolved December 13, 2016 at 12:45 PM
Currently, when a user's authentication token expires they loose the state of the application because they are internally re-directed and have their cookies destroyed.
To prevent this, the OpenLMIS-UI application should catch all 401 errors that are returned from the OpenLMIS Server. When this happens, OpenLMIS-UI will open the login screen as a modal window — allowing the user to re-authenticate.
When a user successfully re-authenticates, the HTTP calls that received a 401 error should be retried.
[Angular-http-auth](https://github.com/witoldsz/angular-http-auth) is a library that can implement catching 401 errors and buffering/retrying the failed requests.
The login modal will need to be moved into a bootbox modal.
Acceptance Criteria
Can open deep linked page
(a) Login to OpenLMIS
(b) Navigate to a specific requisition
(c) Copy and paste the URL into another browser
(d) Authenticate in new browser
(e) View same requisition in another browser
Can reauthenticate user to complete a request
(a) Login to OpenLMIS
(b) Open a requisition that is 'submitted'
(c) Invalidate the user's token (see below)
(d) Attempt to authorize the requisition
(e) View login modal, and login (again)
(f) When requests complete, user should see requisition page, with the requisition's state set to 'Authorized'
How to invalidate the user's token
Reset and restart OpenLMIS-Blue server
Delete 'access_token' from the browser's local storage cache