diff options
author | 2021-06-19 11:18:55 +0200 | |
---|---|---|
committer | 2021-06-19 11:18:55 +0200 | |
commit | aa8a0d08501cbb22400a67ece85c45fdfbdc6131 (patch) | |
tree | 4a4581fb8f1c9bf8cac742be15d7a57eec170a1b /internal/oauth/server.go | |
parent | update CONTRIBUTING with css bundling instructions, and go fmt (#48) (diff) | |
download | gotosocial-aa8a0d08501cbb22400a67ece85c45fdfbdc6131.tar.xz |
Streaming (#49)
Add new status and notification websocket streaming capabilities
Diffstat (limited to 'internal/oauth/server.go')
-rw-r--r-- | internal/oauth/server.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/oauth/server.go b/internal/oauth/server.go index fb84743cd..1289b18af 100644 --- a/internal/oauth/server.go +++ b/internal/oauth/server.go @@ -56,6 +56,7 @@ type Server interface { HandleAuthorizeRequest(w http.ResponseWriter, r *http.Request) error ValidationBearerToken(r *http.Request) (oauth2.TokenInfo, error) GenerateUserAccessToken(ti oauth2.TokenInfo, clientSecret string, userID string) (accessToken oauth2.TokenInfo, err error) + LoadAccessToken(ctx context.Context, access string) (accessToken oauth2.TokenInfo, err error) } // s fulfils the Server interface using the underlying oauth2 server @@ -171,3 +172,7 @@ func (s *s) GenerateUserAccessToken(ti oauth2.TokenInfo, clientSecret string, us s.log.Tracef("obtained user-level access token: %+v", accessToken) return accessToken, nil } + +func (s *s) LoadAccessToken(ctx context.Context, access string) (accessToken oauth2.TokenInfo, err error) { + return s.server.Manager.LoadAccessToken(ctx, access) +} |