mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-01 00:08:27 +01:00
Merge pull request #293 from panel/auth-docs
Add example and documentation around triggering login modal #234
This commit is contained in:
commit
f65655f7cc
@ -22,6 +22,16 @@ unleash.start({
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Additionally, you can trigger the admin interfact to prompt the user to sign in by configuring your middleware to return a `401` status on
|
||||||
|
protected routes. The response body must contain a `message` and a `path` used to redirect the user to the proper login route.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"message": "You must be logged in to use Unleash",
|
||||||
|
"path": "/custom/login"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
Examples on custom authentication hooks:
|
Examples on custom authentication hooks:
|
||||||
- [google-auth-hook.js](https://github.com/Unleash/unleash/blob/master/examples/google-auth-hook.js)
|
- [google-auth-hook.js](https://github.com/Unleash/unleash/blob/master/examples/google-auth-hook.js)
|
||||||
- [basic-auth-hook.js](https://github.com/Unleash/unleash/blob/master/examples/basic-auth-hook.js)
|
- [basic-auth-hook.js](https://github.com/Unleash/unleash/blob/master/examples/basic-auth-hook.js)
|
||||||
|
Loading…
Reference in New Issue
Block a user