1 files changed, 6 insertions(+), 2 deletions(-)

M bearer.go
M bearer.go +6 -2
@@ 31,6 31,7 @@ func ToTimestamp(t time.Time) Timestamp 
 // BearerToken ...
 type BearerToken struct {
 	Version  uint
+	Type     string
 	Issued   Timestamp
 	Expires  Timestamp
 	Grants   string

          
@@ 39,9 40,12 @@ type BearerToken struct {
 }
 
 // Encode ...
-func (bt *BearerToken) Encode(ctx context.Context) string {
+func (b *BearerToken) Encode(ctx context.Context) string {
 	kw := crypto.KWForContext(ctx)
-	plain, err := bare.Marshal(bt)
+	if b.Type == "" {
+		b.Type = "OAUTH2"
+	}
+	plain, err := bare.Marshal(b)
 	if err != nil {
 		panic(err)
 	}