aboutsummaryrefslogtreecommitdiff
path: root/internal/auth/model.go
diff options
context:
space:
mode:
authorMax Resnick <max@ofmax.li>2020-11-08 11:45:16 -0800
committerMax Resnick <max@ofmax.li>2021-01-01 10:50:14 -0800
commita397341ad471cc761f7fb930d77e53cf7eb40a2a (patch)
tree76fb8318269569687fdd30467dc61ecba3499d09 /internal/auth/model.go
parent689a57ec4a444f8233fe2e5ec7ceb0903218218d (diff)
downloadiserv-a397341ad471cc761f7fb930d77e53cf7eb40a2a.tar.gz
adds casbin and accounts
Diffstat (limited to 'internal/auth/model.go')
-rw-r--r--internal/auth/model.go15
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,