springboot-angular2-tutorial / boot-app

This repository is an example application for Spring Boot and Angular2 tutorial.
MIT License
113 stars 42 forks source link

refactored authentication into a restcontroller #5

Closed rixlabs closed 8 years ago

rixlabs commented 8 years ago

Let's open the pull request. :)

As you can see I created a controller that manage the authentication part.

The functionality is the same but I find it more readable.

In the SecurityConfig the creation of the bean is also for readability.

Let me know what do you think.

akirasosa commented 8 years ago

@rixlabs It looks really nice refactoring. 👍 Please let me write a few comments for more improvements.

rixlabs commented 8 years ago

Need access to my repo or you merge first?

rixlabs commented 8 years ago

About defining the bean in another class it could be good looking from encapsulation side but it would create another file for the security configuration that is used only in SecurityConfig class. So it's good for separating concerns but add another file to the config. For me it can stay inside SecurityConfig but is up to you.

For the method addAuthentication of TokenAuthenticationService I will delete it

rixlabs commented 8 years ago

I commited the change but I forgotted to clean the imports.

I'm doing also that part now

akirasosa commented 8 years ago

@rixlabs Great. Merged. Thanks!

rixlabs commented 8 years ago

I found a bad BUG about the authenticationManager!!!!

I'll fixit and send another commit.

I'm sorry forgot to test with anonymous