Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinGallauner committed May 9, 2024
1 parent c3f2e4c commit 0dbbf15
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ Connect your physical bookshelf with your friends!
- Run `go build && ./bookclub`.

## API

* You can find the swagger documentation at `http://localhost:8080/swagger/index.html`
* Fetch book from OpenLibrary API ` GET http://localhost:8080/api/books/{isbn}`
* Add book to the logged in user `POST http://localhost:8080/api/collection/{isbn}`



## Trade offs
- I regret adding Gorm as the ORM library.
- The search implementation is not okay.
Expand Down
4 changes: 2 additions & 2 deletions internal/handler_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (cfg *BookclubServer) handlerLogout(w http.ResponseWriter, r *http.Request)
}

func (cfg *BookclubServer) handlerLogin(w http.ResponseWriter, r *http.Request) {
r = r.WithContext(context.WithValue(context.Background(), "provider", "google")) //todo I don't fully understand that tbh
r = r.WithContext(context.WithValue(context.Background(), "provider", "google"))
// try to get the user without re-authenticating
gothUser, err := cfg.AuthService.CompleteUserAuth(w, r)
if err != nil {
Expand All @@ -58,5 +58,5 @@ func (cfg *BookclubServer) handlerLogin(w http.ResponseWriter, r *http.Request)
type LoginResponse struct {
Name string
Email string
Jwt string //todo reconsider naming
Jwt string //todo naming?
}

0 comments on commit 0dbbf15

Please sign in to comment.