* Add phone call authentication method * Remove dynamic mem allocation from error handler * Add more error handling code * Move error handling to different file * Remove Socket IO dependency * cleanup in websocket code * Add rapidjson as cmake dependency * Added Dockerfiles as primary build system for packages * Changed policy in CMakeList to work with lower version of CMake * Fix opensuse builds * Link filesystem library in gcc 8.5 or older
32 lines
674 B
C++
32 lines
674 B
C++
#pragma once
|
|
|
|
#include <rublon/stdlib.hpp>
|
|
|
|
namespace rublon {
|
|
|
|
class AuthenticationStatus {
|
|
public:
|
|
enum class Action { Denied, Confirmed, Bypass };
|
|
|
|
AuthenticationStatus(Action action, std::string authenticationToken = "")
|
|
: _action{action}, _authenticationToken{std::move(authenticationToken)} {}
|
|
|
|
constexpr bool userAuthorized() const {
|
|
return _action == Action::Confirmed;
|
|
}
|
|
|
|
Action action() const {
|
|
return _action;
|
|
}
|
|
|
|
std::string_view accessToken() const {
|
|
return _authenticationToken;
|
|
}
|
|
|
|
private:
|
|
Action _action;
|
|
std::string _authenticationToken; /// TODO dynamic mem
|
|
};
|
|
|
|
} // namespace rublon
|