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

Compilation error saying incompatible types for getCurrentUser #107

Closed
siva-nadella-lab opened this issue Apr 2, 2024 · 6 comments · Fixed by #108
Closed

Compilation error saying incompatible types for getCurrentUser #107

siva-nadella-lab opened this issue Apr 2, 2024 · 6 comments · Fixed by #108
Labels

Comments

@siva-nadella-lab
Copy link

Describe the bug
I have tried to use loopback4-authentication and loopback4-auditlog and when I try to change my repository to extend from AuditRepositoryMixin, it throws the following error message. We are unsure if any step is missed out or if these are compatible libraries.

Class 'HospitalRepository' incorrectly extends base class 'DefaultCrudRepository<Hospital, any, HospitalRelations> & IAuditMixin'.
Type 'HospitalRepository' is not assignable to type 'IAuditMixin'.
The types returned by 'getCurrentUser()' are incompatible between these types.
Type 'Promise' is not assignable to type 'Promise<User<string, string, string>>'.
Type 'IAuthUser' is missing the following properties from type 'User<string, string, string>': permissions, authClientId, role, firstName, lastName

To Reproduce
Please provide a user who can review the changes in our Git repository and I can add them to view the issue.

@Tyagi-Sunny
Copy link
Contributor

hii @siva-nadella-lab , add @Tyagi-Sunny & @yeshamavani

@siva-nadella-lab
Copy link
Author

Thank you Sunny!

Please refer to this folder. The committed code is with the compilation error.

https://github.com/siva-nadella-lab/play-arena/tree/main/ivue-referral-api-new-mongodb

Tyagi-Sunny added a commit that referenced this issue Apr 2, 2024
@yeshamavani
Copy link
Contributor

@siva-nadella-lab we will fix from our end
but a small change that observed you need to do is
image

this will get the same user that you are saving in your authenticate sequence step

Tyagi-Sunny added a commit that referenced this issue Apr 2, 2024
yeshamavani pushed a commit that referenced this issue Apr 3, 2024
Tyagi-Sunny added a commit that referenced this issue Apr 3, 2024
refactor test cases related to pr 108

gh-107
yeshamavani pushed a commit that referenced this issue Apr 3, 2024
@yeshamavani
Copy link
Contributor

🎉 This issue has been resolved in version 7.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@yeshamavani
Copy link
Contributor

@siva-nadella-lab A new version is released please check and let us know if you have any further queries
Bot has closed this issue feel free to raise a new one if required.

@siva-nadella-lab
Copy link
Author

Thank you for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants