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

fix(mixins): receive a function instead of the hash module directly #230

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

RomainLanz
Copy link
Member

Hey there! 👋🏻

This PR changes the argument of withAuthFinder.

Before, we were receiving directly the hash module.

const AuthFinder = withAuthFinder(hash.use('scrypt'), {
  uids: ['email'],
  passwordColumnName: 'password',
})

This was causing some issues if you used the mixin before the app boot (i.e, in a command).

Moving to a function-based approach makes it work since we are delaying the access to hash.

const AuthFinder = withAuthFinder(() => hash.use('scrypt'), {
  uids: ['email'],
  passwordColumnName: 'password',
})

Note

Preset and documentation must be updated to reflect the change.

@thetutlage
Copy link
Member

Looks good. Can you please update the preset and the docs both?

@thetutlage thetutlage self-requested a review January 24, 2024 09:22
RomainLanz added a commit to adonisjs/presets that referenced this pull request Jan 24, 2024
@RomainLanz RomainLanz merged commit 3c5018c into develop Jan 24, 2024
12 checks passed
@RomainLanz RomainLanz deleted the fix/mixins branch January 24, 2024 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants