Open zinosama opened 4 years ago
#credentials to be called once per callback request.
#credentials
#credentials is called twice per callback request.
Is there any reason OmniAuth::Strategy#credentials is not memoized given that OmniAuth::Strategy#auth_hash always invokes it twice in a row:
OmniAuth::Strategy#credentials
OmniAuth::Strategy#auth_hash
# OmniAuth::Strategy#auth_hash hash.credentials = credentials if credentials
This results in all providers' credentials block to be evaluated twice per callback request.
credentials
I'm happy to open a fix for this if maintainers are open to it. Thoughts? @BobbyMcWho
I'm open to a PR, I'm not intimate with that section of code in particular
Expected Behavior
#credentials
to be called once per callback request.Actual Behavior
#credentials
is called twice per callback request.Question
Is there any reason
OmniAuth::Strategy#credentials
is not memoized given thatOmniAuth::Strategy#auth_hash
always invokes it twice in a row:This results in all providers'
credentials
block to be evaluated twice per callback request.I'm happy to open a fix for this if maintainers are open to it. Thoughts? @BobbyMcWho