mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-31 01:47:13 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			27 lines
		
	
	
		
			454 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			454 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| const rq = require('./request');
 | |
| 
 | |
| const auth = {
 | |
|   username: 'admin',
 | |
|   email: 'admin@strapi.io',
 | |
|   password: 'pcw123'
 | |
| };
 | |
| 
 | |
| module.exports = {
 | |
|   auth,
 | |
|   login: () => {
 | |
|     return new Promise(async (resolve) => {
 | |
|       const body = await rq({
 | |
|         url: `/auth/local`,
 | |
|         method: 'POST',
 | |
|         body: {
 | |
|           identifier: auth.email,
 | |
|           password: auth.password
 | |
|         },
 | |
|         json: true
 | |
|       });
 | |
| 
 | |
|       resolve(body);
 | |
|     });
 | |
|   }
 | |
| };
 | 
