(sessionId string)
| 676 | } |
| 677 | |
| 678 | func (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 | |
| 698 | func (auth *AuthService) GetOAuthService(sessionId string) (OAuthServiceImpl, error) { |
| 699 | session, err := auth.GetOAuthPendingSession(sessionId) |
no test coverage detected