Adding oidc email scope check#1610
Conversation
32038d8 to
45bc3be
Compare
sagikazarmark
left a comment
There was a problem hiding this comment.
LGTM, only a few suggestions
There was a problem hiding this comment.
This check is not necessary because of default values.
There was a problem hiding this comment.
I would revert this, because it doesn't change behavior at all.
|
Further thinking about this: |
7f049f0 to
cbed29a
Compare
|
Yep, it has sense. I will change the behavior according to your thoughts. |
b03ed83 to
c4ebee2
Compare
There was a problem hiding this comment.
How about:
hasEmailScope := false
for _, s := range c.oauth2Config.Scopes {
if s == "email" {
hasEmailScope = true
break
}
}
Feels a bit cleaner and more readable
There was a problem hiding this comment.
You could merge these two ifs. The default value of email is an empty string because of the type.
There was a problem hiding this comment.
Yep, you are right. Fixed.
This helps to avoid "no email claim" error if email scope was not specified. Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
c4ebee2 to
383c2fe
Compare
This helps to avoid "no email claim" error if the email scope was not specified.
Signed-off-by: m.nabokikh maksim.nabokikh@flant.com
Closes #1598