Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since LoginProvider & BaseLoginProvider are exported from the lib, as consumers we can implement our own login providers.
That's good but we seem forced to create our login provider instances directly when we provide a value for
SocialAuthServiceConfig
, and we have no easy way to inject other services in our custom login providers.This PR should make something like this possible
MyCustomLoginProvider
would then be a real angular provider.A change was made also on
getLoginStatus(refreshToken?: boolean): Promise<SocialUser>
signature, it was splitted intogetLoginStatus(): Promise<SocialUser>
&refreshToken?(): Promise<SocialUser | null>
.The
refreshToken?: boolean
parameter was only used by GoogleLoginProvider, and passing true to it was doing something really different of passing false.With that new optional refreshToken() method that providers can implement, we just need to check for the presence of a refreshToken function in
SocialAuthService.refreshAuthToken()
signIn()
method abstract again inBaseLoginProvider
,GoogleLoginProvider
implements it again but rejects with a message saying it is no longer supported, with a link to Google doc.