express-user-manager icon indicating copy to clipboard operation
express-user-manager copied to clipboard

Demo app

Open jakern opened this issue 3 years ago • 1 comments

Do you have any interest in building a demo app to show off all the features of express-user-manager? I gave it a shot this weekend and couldn't get past how though req.session.user is set in the login handler, that user data isn't available when I make the next call, in the loggedIn and authorized middleware.

Here is my repo if seeing it would help. I'm just using httpie to make the requests for now.

Any help would be appreciated. Thanks for such a handy tool.

jakern avatar Oct 03 '21 22:10 jakern

Hi @jakern , definitely, that would be great.

I have taken a look at your code. Everything looks okay, with just one exception. The codebase is missing a .env file. What you have instead is an ENV file with export-ed values. What you need, however, is a .env file. pronounced dotenv. You also have to remove the export keywords in front of the environment variables defined inside the file. Here's an example of (the contents of) such a file:

# Filename: .env

DB_ADAPTER="sequelize"
SESSION_SECRET="Iamagreatsecret"
PASSWORD_MIN_LENGTH=8
PASSWORD_MAX_LENGTH=32
AUTH_TOKEN_SECRET="THIsistotallyabettersecret"
AUTH_TOKEN_EXPIRY="3600"

I hope this helps.

P.S. Sorry it took this long to respond. I had been occupied in the past few days.

simplymichael avatar Oct 14 '21 15:10 simplymichael