Skip to content

Conversation

@RamiroGonzalez89
Copy link
Contributor

@RamiroGonzalez89 RamiroGonzalez89 commented Aug 22, 2018

Background

  • Protect Rest API with JWT token

Changes Done

  • Backend
    • Implement jwt middleware in TSOA
    • Add AuthController with login exposed method that signs the credentials with token
    • Add jwt security to protect Rest endpoints
    • Removes migrate and seeds broken commands
  • Frontend
    • ApiService module
    • Added support to run different environments for backend service

Pending

  • Adds validation to form - Almost done
  • Adds Error handler - Done
  • Adds Tests
  • Saves token in localStorage and pass them in each request made in headers. (ApiService request method) - Done

Persist Login when token

security-interceptor-keepslogged-when-token

Login Case

backend-frontend-jwt-working

@RamiroGonzalez89 RamiroGonzalez89 changed the title Develop BE/Implements-JWT-Authentication Aug 28, 2018
@RamiroGonzalez89 RamiroGonzalez89 changed the title BE/Implements-JWT-Authentication BE-FE/Implements-JWT-Authentication Aug 28, 2018
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please let's try to avoid single letter variables, is very difficult to understand the code in this way
why do we need to use proto ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is re utilized from react-backend repository which was wrote like this, I can do a deep research to refactor the backend and be more descriptive from a intent perspective

config = parseDatabaseArguments(process.argv);
}
return config;
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this file? seems part of some code generator?, is necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote this before in the react-backend repository in order to be able to run the localDatabase with arguments passed to the npm script, something like... npm run start:local dbname=localhost dbusername=myDbUser dbpassword=myDbPass

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.

3 participants