-
Notifications
You must be signed in to change notification settings - Fork 0
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
User sign up api #6
Conversation
- Just wanted to see if the database is hooked up properly. With the ssh requirements on the COA001 box, I couldn't figure out how to get a proper tunnel in to connect. Made my own postgres box for now, and am connecting to that instead
- Simple migration (need to add a lot more fields for later) - User model (Bookshelf based) - User test (Mocha) that tests saving, for sanity check - Database helper to kill test pollution on the database (truncates before each example and after all tests) - Test helper to deal with Promise based testing
- Also added in good logging, seems to be highly recommended. Only has logs to the console right now though, will figure out some kind of file logging and log rotation system later
- I'm using a DCI inspired pattern. CreatingUser is basically a domain level object, to separate server concerns from the actual object model
- Using Joi for validation - Had to add in chai-as-promised and create a wrapper method for Hapi server injection in order to test routes with a Promise interface
@seansu4you87 I'm using JWT on another project (cookie storage, but I want local storage) Do you have plans for that? I don't think we mentioned this JWT detail. |
There's a hapi auth plugin for that. This is for authentication right (not sure what you mean by local storage here) |
The frontend needs to store the JWT somewhere to call the API. This token can be stored in a cookie, localStorage, or windowStorage https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API |
Oh got it, localStorage on the browser. I thought you were talking about
|
Basic code for user sign up. The model is HEAVILY simplified right now. I'm waiting on flow diagrams/more context to figure out what exactly the columns and whatnot need to be.