Add provider_id to cookie data

This commit is contained in:
Marcos Lilljedahl
2019-06-22 16:08:04 -03:00
parent cf25f7592a
commit 92299bdcbf
2 changed files with 2 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ type CookieID struct {
Id string `json:"id"` Id string `json:"id"`
UserName string `json:"user_name"` UserName string `json:"user_name"`
UserAvatar string `json:"user_avatar"` UserAvatar string `json:"user_avatar"`
ProviderId string `json:"provider_id"`
} }
func (c *CookieID) SetCookie(rw http.ResponseWriter, host string) error { func (c *CookieID) SetCookie(rw http.ResponseWriter, host string) error {

View File

@@ -198,7 +198,7 @@ func LoginCallback(rw http.ResponseWriter, req *http.Request) {
return return
} }
cookieData := CookieID{Id: user.Id, UserName: user.Name, UserAvatar: user.Avatar} cookieData := CookieID{Id: user.Id, UserName: user.Name, UserAvatar: user.Avatar, ProviderId: user.ProviderUserId}
host := "localhost" host := "localhost"
if req.Host != "" { if req.Host != "" {