diff options
Diffstat (limited to '')
| -rw-r--r-- | internal/auth/model.go | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/internal/auth/model.go b/internal/auth/model.go index c51ff05..240b11b 100644 --- a/internal/auth/model.go +++ b/internal/auth/model.go @@ -6,20 +6,10 @@ import ( "golang.org/x/oauth2" ) -// GoogleAuthProfile auth'd user profile -// ProfileId, Email, Name, PictureURL -type GoogleAuthProfile struct { - ProfileID string `json:"sub"` - Email string `json:"email"` - Name string `json:"name"` - PictureURL string `json:"picture"` -} - // Profile profile and token // Identifier + Token type Profile struct { ID string `json:"sub"` - Email string `json:"email"` AccessToken string `json:"access_token"` TokenType string `json:"token_type,omitempty"` RefreshToken string `json:"refresh_token,omitempty"` @@ -37,10 +27,9 @@ func (ap *Profile) Token() (*oauth2.Token, error) { } // NewAuthProfile merge token and profile -func NewAuthProfile(t *oauth2.Token, u *GoogleAuthProfile) *Profile { +func NewAuthProfile(t *oauth2.Token, id string) *Profile { return &Profile{ - u.ProfileID, - u.Email, + id, t.AccessToken, t.TokenType, t.RefreshToken, |