Lock Screen
Although the API is called lock-screen
, it can not actually lock the user`s screen. You will need to implement that in your codebase. Instead, it returns a session object with an empty access value, effectively locking the user out of the application. The user must then refresh the access values by submitting their password to the API.
INFO
The user object contains a screen_locked
boolean value that you can use to determine if the user is locked out of the application. However, you don't need to use this value to implement a lock screen feature in your app. The removal of the access values is sufficient, as the user will be unable to access any features until they unlock the screen.
WARNING
In demo mode, the lock screen feature is simulated. As the access values are already empty.
Lock
GET https://api.backstack.com/user/lock-screen
Returns a session object with an empty access value.
// session object
{
...
"access": {},
"user": {
...,
"screen_locked": true
},
...
}
Unlock
POST https://api.backstack.com/user/lock-screen
{
"password": "Mh344q!ioe"
}
Returns a session object with the original access value.
// session object
{
...
"access": {
"some-feature": "crud",
...
},
"user": {
...,
"screen_locked": false
},
...
}