MCPcopy
hub / github.com/tinyauthapp/tinyauth / GetOAuthUserinfo

Method GetOAuthUserinfo

internal/service/auth_service.go:678–696  ·  view source on GitHub ↗
(sessionId string)

Source from the content-addressed store, hash-verified

676}
677
678func (auth *AuthService) GetOAuthUserinfo(sessionId string) (config.Claims, error) {
679 session, err := auth.GetOAuthPendingSession(sessionId)
680
681 if err != nil {
682 return config.Claims{}, err
683 }
684
685 if session.Token == nil {
686 return config.Claims{}, fmt.Errorf("oauth token not found for session: %s", sessionId)
687 }
688
689 userinfo, err := (*session.Service).GetUserinfo(session.Token)
690
691 if err != nil {
692 return config.Claims{}, fmt.Errorf("failed to get userinfo: %w", err)
693 }
694
695 return userinfo, nil
696}
697
698func (auth *AuthService) GetOAuthService(sessionId string) (OAuthServiceImpl, error) {
699 session, err := auth.GetOAuthPendingSession(sessionId)

Callers 1

oauthCallbackHandlerMethod · 0.80

Calls 2

GetUserinfoMethod · 0.65

Tested by

no test coverage detected