mirror of
https://github.com/mentos1386/zdravko.git
synced 2024-11-26 01:07:52 +00:00
fix(oauth2): id is int for github
This commit is contained in:
parent
9e237a0b71
commit
5dfc7f0227
1 changed files with 5 additions and 4 deletions
|
@ -8,6 +8,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"code.tjo.space/mentos1386/zdravko/internal/config"
|
"code.tjo.space/mentos1386/zdravko/internal/config"
|
||||||
|
@ -16,7 +17,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type UserInfo struct {
|
type UserInfo struct {
|
||||||
Id int64 `json:"id"` // FIXME: This might not always be int?
|
Id int `json:"id"` // FIXME: This might not always be int?
|
||||||
Sub string `json:"sub"`
|
Sub string `json:"sub"`
|
||||||
Email string `json:"email"`
|
Email string `json:"email"`
|
||||||
}
|
}
|
||||||
|
@ -138,9 +139,9 @@ func (h *BaseHandler) OAuth2CallbackGET(w http.ResponseWriter, r *http.Request)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
userId := userInfo.Id
|
userId := userInfo.Sub
|
||||||
if userInfo.Sub != "" {
|
if userInfo.Id != 0 {
|
||||||
userId = userInfo.Sub
|
userId = strconv.Itoa(userInfo.Id)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = h.SetAuthenticatedUserForRequest(w, r, &AuthenticatedUser{
|
err = h.SetAuthenticatedUserForRequest(w, r, &AuthenticatedUser{
|
||||||
|
|
Loading…
Reference in a new issue