MCPcopy Create free account
hub / github.com/GlobedGD/globed2 / threadTryAuth

Method threadTryAuth

src/core/net/NetworkManagerImpl.cpp:981–1015  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

979}
980
981Future<> NetworkManagerImpl::threadTryAuth() {
982 if (auto stoken = this->getUToken()) {
983 this->connInfo()->startedAuth();
984 this->sendCentralAuth(AuthKind::Utoken, *stoken);
985 co_return;
986 }
987
988 // try argon / plain auth
989 auto info = this->connInfo();
990
991 if (!info->m_knownArgonUrl.empty()) {
992 (void) argon::setServerUrl(info->m_knownArgonUrl);
993
994 // wait to acquire an argon token
995 info.unlock();
996 log::debug("acquiring argon token with url {}", info->m_knownArgonUrl);
997 auto res = co_await startArgonAuth();
998
999 if (!res) {
1000 this->abortConnection(fmt::format("failed to complete Argon auth: {}", res.unwrapErr()));
1001 co_return;
1002 }
1003
1004 info.relock();
1005 info->startedAuth();
1006 info.unlock();
1007
1008 this->sendCentralAuth(AuthKind::Argon, *res);
1009 } else {
1010 info->startedAuth();
1011 info.unlock();
1012
1013 this->sendCentralAuth(AuthKind::Plain);
1014 }
1015}
1016
1017#ifdef GEODE_IS_WINDOWS
1018static bool isWine() {

Callers 1

threadWorkerLoopMethod · 0.95

Calls 7

getUTokenMethod · 0.95
connInfoMethod · 0.95
sendCentralAuthMethod · 0.95
abortConnectionMethod · 0.95
startArgonAuthFunction · 0.85
startedAuthMethod · 0.80
emptyMethod · 0.80

Tested by

no test coverage detected