aboutsummaryrefslogtreecommitdiff
path: root/zenserver/auth/authmgr.cpp
diff options
context:
space:
mode:
authorPer Larsson <[email protected]>2022-01-28 13:03:44 +0100
committerPer Larsson <[email protected]>2022-01-28 13:03:44 +0100
commitc775f3f39bc2a3d8c018c3a925a7cd61231ef3a9 (patch)
tree152399c6b8aa05e51107801431c65a938e0a788f /zenserver/auth/authmgr.cpp
parentExtended auth mgr to restore OpenID provider(s) and token(s). (diff)
downloadzen-c775f3f39bc2a3d8c018c3a925a7cd61231ef3a9.tar.xz
zen-c775f3f39bc2a3d8c018c3a925a7cd61231ef3a9.zip
Get access token from auth mgr.
Diffstat (limited to 'zenserver/auth/authmgr.cpp')
-rw-r--r--zenserver/auth/authmgr.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/zenserver/auth/authmgr.cpp b/zenserver/auth/authmgr.cpp
index 20bc7c988..28e128fc0 100644
--- a/zenserver/auth/authmgr.cpp
+++ b/zenserver/auth/authmgr.cpp
@@ -116,6 +116,20 @@ public:
return true;
}
+ virtual OpenIdAccessToken GetOpenIdAccessToken(std::string_view ProviderName) final
+ {
+ std::unique_lock _(m_TokenMutex);
+
+ if (auto It = m_OpenIdTokens.find(std::string(ProviderName)); It != m_OpenIdTokens.end())
+ {
+ const OpenIdToken& Token = It->second;
+
+ return {.AccessToken = Token.AccessToken};
+ }
+
+ return {};
+ }
+
private:
bool OpenIdProviderExist(std::string_view ProviderName)
{