Closed petrenslavik closed 1 year ago
I also think it will be better to make Provider and ClientSecret properties to be protected instead of private to be able to use them in the inherited class instead of creating new fields.
This PR was released as part of version 2.3.0
Description of changes: The issue is related to the https://github.com/aws/aws-aspnet-cognito-identity-provider package when used with a custom ApplicationUser class inherited from CognitoUser. The problem is that CognitoUserStore in methods FindByEmailAsync and FindByIdAsync use CognitoUserPool to get the user and then tries to upcast this instance which obviously leads to the user being null.
Adding virtual modifiers will allow changing the implementation of CognitoUserPool methods to return custom own instances.
I understand that I can create a new inherited from CognitoUserStore implementation of the store to override these 2 methods with a custom CognitoUserPool, but this PR will reduce this boilerplate code. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.