Skip to content

Conversation

smacker
Copy link
Contributor

@smacker smacker commented Jan 19, 2018

Fixes: #20

  • OAuth2 with github
  • JWT
  • Keep token in local storage
  • Removed service worker (it catches all locations and I don't see how
    to override it without create-react-app eject)

TBD:

@bzz bzz removed the review label Jan 19, 2018
Copy link
Contributor

@dpordomingo dpordomingo left a comment

Choose a reason for hiding this comment

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

I focused on reviewing the front part, and since it helps you to keep working, LGTM.
I can rearrange the API part once #16 has been approved

@smacker smacker mentioned this pull request Jan 19, 2018
func (j *JWT) MakeToken(user *model.User) (string, error) {
claims := &jwtClaim{ID: user.ID}
t := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
fmt.Println("skey", j.signingKey)
Copy link
Contributor

Choose a reason for hiding this comment

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

remove

@carlosms
Copy link
Contributor

I only have two comments:

  • There are secrets that need to be provided, so the documentation should explain what and where to put them. For instance, when the docker image is created to test things locally.
  • Right now there isn't a logout functionality, and maybe that was not part of this effort, but it should be added at some point.

@smacker
Copy link
Contributor Author

smacker commented Jan 19, 2018

@carlosms very good points!

  1. I'll update README as soon as we decide to proceed with environment variables not flags. @bzz @dpordomingo please confirm
  2. We discussed it offline. Solution: Logout only on FE (because JWT doesn't have logout out of the box). But we need "logout button" on wireframes. @bzz @dpordomingo please approve or disapprove. @ricardobaeta please add logout on wireframes.

@smacker
Copy link
Contributor Author

smacker commented Jan 19, 2018

blocked by #16 and structure review.

Copy link
Contributor

@dpordomingo dpordomingo left a comment

Choose a reason for hiding this comment

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

I'd not block this PR because of #16
imho this can be merged, and I'll rebase and rework on top of this one. I think it will be better because this functionality is already "completed" from the back to the FE

@bzz
Copy link
Contributor

bzz commented Jan 19, 2018

Sounds good, let @smacker finish last few things in here i.e documenting in README how the user should create/provide token \w minimal permissions and set it for a Docker image built locally and then merge this one first.

@smacker smacker force-pushed the auth branch 3 times, most recently from ee859c9 to 06506a4 Compare January 19, 2018 16:12
* OAuth2 with github
* JWT
* Keep token in local storage
* Removed service worker (it catches all locations and I don't see how
to override it without create-react-app eject)

Signed-off-by: Maxim Sukharev <maxim@sourced.tech>
@smacker
Copy link
Contributor Author

smacker commented Jan 19, 2018

  1. redundant fmt.Println() is removed
  2. added action logout (but no link yet)
  3. documentation is updated
  4. Tests will be written later because the code is about to change a lot after Backend Api mocks #16

Merging.

@smacker smacker changed the title [WIP] Authorization Authorization Jan 19, 2018
@smacker smacker merged commit 81b9483 into src-d:master Jan 19, 2018
dpordomingo pushed a commit that referenced this pull request Mar 26, 2018
add node and npm as dependencies
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.

5 participants