We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
try { account = await Account.findById(userid) } catch (e) { throw e }
I'm trying to access the hash property directly using the loaded account, with account.hash but it's undefined... am I doing something wrong?
hash
account.hash
undefined
The text was updated successfully, but these errors were encountered:
getting the same result for account.get('hash')
the hash is valid and exists in the db
Sorry, something went wrong.
Got same problem can't find the hash and salt from the callback, any help or way around this.. I need to hash a password
For anyone else that ends up here, you can return hash/ salt using the following:
var accountWithHash = await Account.findByUsername(username, true);
From the docs:
findByUsername() convenience method to find a user instance by it's unique username.
What I didn't find in the docs but did in reviewing the source code, is that you can include salt and hash fields in the returned object, if the second parameter is a boolean and set to 'true': https://github.com/saintedlama/passport-local-mongoose/blob/master/index.js#L283
These attributes are intentionally filtered out of Account.findOne() / Account.findById() methods.
No branches or pull requests
I'm trying to access the
hash
property directly using the loaded account, withaccount.hash
but it'sundefined
... am I doing something wrong?The text was updated successfully, but these errors were encountered: