mirror of
				https://gitlab.com/comunic/comunicterm
				synced 2025-10-31 02:04:44 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			37 lines
		
	
	
		
			528 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
		
			528 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /**
 | |
|  * Account helper
 | |
|  *
 | |
|  * @author Pierre HUBERT
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <string>
 | |
| #include <vector>
 | |
| 
 | |
| enum LoginResult {
 | |
|     ERROR,
 | |
|     BAD_PASSWORD,
 | |
|     TOO_MANY_ATTEMPTS,
 | |
|     SUCCESS
 | |
| };
 | |
| 
 | |
| class AccountHelper
 | |
| {
 | |
| public:
 | |
|     AccountHelper();
 | |
| 
 | |
|     static LoginResult Login(const std::string &email,
 | |
|                       const std::string &pass);
 | |
| 
 | |
| 
 | |
|     static int userID();
 | |
| 
 | |
|     static std::vector<std::string> loginTokens();
 | |
| 
 | |
| private:
 | |
|     static int mUserID;
 | |
|     static std::string mToken1;
 | |
|     static std::string mToken2;
 | |
| };
 |