feat: login with apple
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user