mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			15 lines
		
	
	
		
			408 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			408 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { Application } from 'express';
 | |
| import NoAuthUser from '../types/no-auth-user';
 | |
| 
 | |
| function noneAuthentication(basePath = '', app: Application): void {
 | |
|     app.use(`${basePath}/api/admin/`, (req, res, next) => {
 | |
|         // @ts-ignore
 | |
|         if (!req.user) {
 | |
|             // @ts-expect-error
 | |
|             req.user = new NoAuthUser();
 | |
|         }
 | |
|         next();
 | |
|     });
 | |
| }
 | |
| export default noneAuthentication;
 |