mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	Update client-auth-unleash.js
This commit is contained in:
		
							parent
							
								
									7f07d77d44
								
							
						
					
					
						commit
						47fa70ceed
					
				@ -12,10 +12,10 @@ unleash
 | 
				
			|||||||
        enableLegacyRoutes: false,
 | 
					        enableLegacyRoutes: false,
 | 
				
			||||||
        preRouterHook: app => {
 | 
					        preRouterHook: app => {
 | 
				
			||||||
            app.use('/api/client', (req, res, next) => {
 | 
					            app.use('/api/client', (req, res, next) => {
 | 
				
			||||||
                if (req.header('authorization') !== sharedSecret) {
 | 
					                if (req.header('authorization') === sharedSecret) {
 | 
				
			||||||
                    res.sendStatus(401);
 | 
					 | 
				
			||||||
                } else {
 | 
					 | 
				
			||||||
                    next();
 | 
					                    next();
 | 
				
			||||||
 | 
					                } else {
 | 
				
			||||||
 | 
					                    res.sendStatus(401);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user