X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=app%2Fuser.go;fp=app%2Fuser.go;h=8465c2ce582b982686ea379bc462b12685efc972;hb=d7a4cd55f58dc548f6f037d59d5ce605824d3f67;hp=86c033c2978b58504d64d6f29a560f6a52eba7ff;hpb=000f6f002f24e742f85ca20503a838c198637125;p=kraftakt.git diff --git a/app/user.go b/app/user.go index 86c033c..8465c2c 100644 --- a/app/user.go +++ b/app/user.go @@ -11,7 +11,8 @@ import ( ) type User struct { - key *datastore.Key + Email string + key *datastore.Key } type dbUser struct { @@ -35,7 +36,8 @@ func NewUser(ctx context.Context, email string) (*User, error) { } return &User{ - key: datastore.NewKey(ctx, "User", email, 0, nil), + Email: email, + key: datastore.NewKey(ctx, "User", email, 0, nil), }, nil } @@ -50,7 +52,8 @@ func UserByID(ctx context.Context, id string) (*User, error) { } return &User{ - key: keys[0], + Email: keys[0].StringID(), + key: keys[0], }, nil }