feat: login with apple

This commit is contained in:
VaalaCat
2024-09-04 18:15:49 +00:00
parent 13148b95e3
commit 0948d23239
13 changed files with 268 additions and 41 deletions

View File

@@ -4,6 +4,7 @@ import (
"context"
"github.com/nose7en/ToyBoomServer/defs"
"github.com/spf13/cast"
)
func GetUser(c context.Context) defs.UserGettable {
@@ -19,3 +20,17 @@ func GetUser(c context.Context) defs.UserGettable {
return u
}
func GetToken(c context.Context) string {
return GetStrValue(c, TokenKey)
}
func GetStrValue(c context.Context, key string) string {
val := c.Value(key)
return cast.ToString(val)
}
func GetStrValueE(c context.Context, key string) (string, error) {
val := c.Value(key)
return cast.ToStringE(val)
}