1
0
mirror of https://gitlab.com/comunic/comunicterm synced 2024-11-16 18:41:07 +00:00
comunicterm/helpers/accounthelper.h

42 lines
682 B
C
Raw Normal View History

2020-01-09 12:13:39 +00:00
/**
* 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);
2020-01-10 14:31:07 +00:00
static bool signedIn();
2020-01-10 15:06:45 +00:00
static void SignOut();
2020-01-10 14:31:07 +00:00
static bool refreshUserID();
2020-01-09 12:13:39 +00:00
static int userID();
2020-01-10 14:31:07 +00:00
static void setLoginTokens(std::vector<std::string> tokens);
2020-01-09 12:13:39 +00:00
static std::vector<std::string> loginTokens();
private:
static int mUserID;
static std::string mToken1;
static std::string mToken2;
};