mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-30 17:37:26 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			18 lines
		
	
	
		
			258 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			258 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| 'use strict';
 | |
| 
 | |
| module.exports = () => ({
 | |
|   type: 'UsersPermissionsMe',
 | |
| 
 | |
|   args: {},
 | |
| 
 | |
|   resolve(parent, args, context) {
 | |
|     const { user } = context.state;
 | |
| 
 | |
|     if (!user) {
 | |
|       throw new Error('Authentication requested');
 | |
|     }
 | |
| 
 | |
|     return user;
 | |
|   },
 | |
| });
 | 
