Ditto  3.0.4
AuthenticationStatus.hpp
1 #ifndef _DITTO_AUTHENTICATION_STATUS_
2 #define _DITTO_AUTHENTICATION_STATUS_
3 
4 #include <string>
5 
6 namespace ditto {
11 public:
15  inline bool is_authenticated() const { return _is_authenticated; }
16 
21  inline std::string get_user_id() const { return _user_id; }
22 
28 
32  AuthenticationStatus(bool is_authenticated, std::string user_id);
33 
34 private:
35  bool _is_authenticated;
36  std::string _user_id;
37 };
38 
39 bool operator==(const AuthenticationStatus &lhs,
40  const AuthenticationStatus &rhs);
41 
42 bool operator!=(const AuthenticationStatus &lhs,
43  const AuthenticationStatus &rhs);
44 
45 } // namespace ditto
46 
47 #endif
Provides info about the authentication status.
Definition: AuthenticationStatus.hpp:10
AuthenticationStatus()
Convenience constructor with is_authenticated set to false and user_id set to the empty string "".
Definition: AuthenticationStatus.cpp:4
bool is_authenticated() const
Returns true if authenticated, otherwise returns false.
Definition: AuthenticationStatus.hpp:15
std::string get_user_id() const
If authenticated, returns the user ID if one was provided by the authentication service....
Definition: AuthenticationStatus.hpp:21