1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-06 01:15:28 +02:00

doc: proper api protection in google auth example. (#1688)

fixes: #1679
This commit is contained in:
Ivar Conradi Østhus 2022-06-09 13:01:15 +02:00 committed by GitHub
parent 6b2696f64c
commit 3d84668ba2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -153,12 +153,12 @@ function googleAdminAuth(app, config, services) {
} }
``` ```
Implement a preRouter hook for `/api/admin`. Implement a preRouter hook for `/api/`.
```js ```js
function googleAdminAuth(app, config, services) { function googleAdminAuth(app, config, services) {
// ... // ...
app.use('/api/admin/', (req, res, next) => { app.use('/api/', (req, res, next) => {
if (req.user) { if (req.user) {
next(); next();
} else { } 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) { if (req.user) {
next(); next();
} else { } else {