mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
doc: proper api protection in google auth example. (#1688)
fixes: #1679
This commit is contained in:
parent
6b2696f64c
commit
3d84668ba2
@ -153,12 +153,12 @@ function googleAdminAuth(app, config, services) {
|
||||
}
|
||||
```
|
||||
|
||||
Implement a preRouter hook for `/api/admin`.
|
||||
Implement a preRouter hook for `/api/`.
|
||||
|
||||
```js
|
||||
function googleAdminAuth(app, config, services) {
|
||||
// ...
|
||||
app.use('/api/admin/', (req, res, next) => {
|
||||
app.use('/api/', (req, res, next) => {
|
||||
if (req.user) {
|
||||
next();
|
||||
} else {
|
||||
@ -234,7 +234,7 @@ function googleAdminAuth(app, config, services) {
|
||||
},
|
||||
);
|
||||
|
||||
app.use('/api/admin/', (req, res, next) => {
|
||||
app.use('/api/', (req, res, next) => {
|
||||
if (req.user) {
|
||||
next();
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user