1
0
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:
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
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 {