#pragma once #include #include #include #include #include #include namespace rublon::method { class WebsocketBasedAuth : public AuthenticationStep< WebsocketBasedAuth > { using base_t = AuthenticationStep< WebsocketBasedAuth >; public: const char * name = ""; WebsocketBasedAuth(std::string systemToken, std::string tid, const char * name) : base_t(std::move(systemToken), std::move(tid)), name{name} {} template < typename Hander_t, typename PamInfo_t = LinuxPam > tl::expected< AuthenticationStatus, Error > handle(const CoreHandlerInterface< Hander_t > & coreHandler, const PamInfo_t & pam) const { log(LogLevel::Info, "starting WS"); pam.print("Waiting for approval"); return coreHandler.waitForConfirmation(_tid); } }; } // namespace rublon::method