#pragma once #include "rublon/static_string.hpp" #include #include namespace rublon { class AuthenticationStatus { public: using tokenT = std::optional< StaticString< 64 > >; enum class Action { Denied, Confirmed, Bypass }; AuthenticationStatus(Action action, const char * token = nullptr) : _action{action}, _authenticationToken{token == nullptr ? tokenT{std::nullopt} : tokenT{token}} {} constexpr bool userAuthorized() const { return _action == Action::Confirmed; } Action action() const { return _action; } std::string_view accessToken() const { return {_authenticationToken->c_str(), _authenticationToken->size()}; } private: Action _action; tokenT _authenticationToken; /// TODO dynamic mem }; } // namespace rublon