Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle nil token returned by ssooidc #4957

Merged
merged 3 commits into from
Aug 18, 2023
Merged

Handle nil token returned by ssooidc #4957

merged 3 commits into from
Aug 18, 2023

Conversation

wty-Bryant
Copy link
Contributor

Modify sso token provider logic to handle possible nil token val returned by ssooidc CreateToken op, possibly will resolve #4947

@wty-Bryant wty-Bryant marked this pull request as ready for review August 17, 2023 20:26
@@ -111,6 +111,10 @@ func (p *SSOTokenProvider) refreshToken(token cachedToken) (cachedToken, error)
if err != nil {
return cachedToken{}, fmt.Errorf("unable to refresh SSO token, %v", err)
}
if createResult == nil || createResult.ExpiresIn == nil ||
createResult.AccessToken == nil || createResult.RefreshToken == nil {
return cachedToken{}, fmt.Errorf("CreateToken returned some nil val without err")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should limit the scope of this change e.g.

if createResult.ExpiresIn == nil {
    return cachedToken{}, fmt.Errorf("missing required field ExpiresIn")
}

@wty-Bryant wty-Bryant merged commit ab7f358 into main Aug 18, 2023
@wty-Bryant wty-Bryant deleted the feat-debug-sso branch August 18, 2023 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panic: runtime error: invalid memory address or nil pointer dereference
3 participants