Skip to content

Commit

Permalink
feat: login working
Browse files Browse the repository at this point in the history
Signed-off-by: Azanul <azanulhaque@gmail.com>
  • Loading branch information
Azanul committed Jun 4, 2024
1 parent 2064038 commit c801862
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/src/components/AuthForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const AuthForm: React.FC<{ mode: 'login' | 'register' }> = ({ mode }) => {

if (response.ok) {
const token = response.headers.get('Authorization');
const user_id = await response.text();
const user_id = JSON.parse(await response.text()).user_id;

if (token) {
localStorage.setItem('token', token);
Expand Down
1 change: 1 addition & 0 deletions user/internal/handler/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ func (h *Handler) Login(w http.ResponseWriter, req *http.Request) {
if err == nil {
w.Header().Add("AUTHORIZATION", token)
w.WriteHeader(http.StatusOK)
m = map[string]string{"user_id": m.(string)}
}
}

Expand Down

0 comments on commit c801862

Please sign in to comment.