adonisjs / auth

Official Authentication package for AdonisJS
https://docs.adonisjs.com/guides/auth/introduction
MIT License
191 stars 65 forks source link

fix: correct type returned by GetProviderRealUser #161

Closed targos closed 3 years ago

targos commented 3 years ago

Without this change, ctx.auth.user returns a Promise, because that's the return type of getUserFor.

targos commented 3 years ago

I picked the Awaited type from https://devblogs.microsoft.com/typescript/announcing-typescript-4-1/#recursive-conditional-types

thetutlage commented 3 years ago

Little confused. I have apps running where user infers correctly to the User instance and not the promise.

targos commented 3 years ago

this bug was introduced yesterday, have you already updated these apps to v6.0.0?

thetutlage commented 3 years ago

Ohhh. Can you point me to the commit that introduced this issue (For my reference)?

thetutlage commented 3 years ago

Found. This is the one https://github.com/adonisjs/auth/commit/48f3570dc576a2b8c5bf2db69575951dd5e49396#diff-cdb9682d900e26a05cb08ccbad22ff4695505d5215de0a25e8ccd5af75c31aa9R62

targos commented 3 years ago

I don't have access to CircleCI. What's the error?

thetutlage commented 3 years ago

Can you also upgrade to the recent version of @poppinss/hooks for the tests to pass?

thetutlage commented 3 years ago

Re: I don't have access to CircleCI. What's the error?

I think they want you to have an account with them and Login. As per https://discuss.circleci.com/t/circleci-builds-remain-private-after-making-github-repo-public/36702/3

targos commented 3 years ago

done

targos commented 3 years ago

I don't really want to create an account with them.

thetutlage commented 3 years ago

Thanks 👍