mirror of
				https://github.com/strapi/strapi.git
				synced 2025-11-04 03:43:34 +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;
 | 
						|
  },
 | 
						|
});
 |