Adding personal type to personal access tokens
2 files changed, 14 insertions(+), 3 deletions(-)

M bearer.go
M routes.go
M bearer.go +12 -2
@@ 12,8 12,18 @@ import (
 	"hg.code.netlandish.com/~netlandish/gobwebs/crypto"
 )
 
-// TokenVersion ...
-const TokenVersion uint = 0
+const (
+	// TokenVersion ...
+	TokenVersion uint = 0
+
+	// Token types
+
+	// TypePersonal ...
+	TypePersonal string = "PERSONAL"
+
+	// TypeOAuth2 ...
+	TypeOAuth2 string = "OAUTH2"
+)
 
 // Timestamp ...
 type Timestamp int64

          
M routes.go +2 -1
@@ 96,6 96,7 @@ func (s *Service) AddPersonal(c echo.Con
 
 		grant := BearerToken{
 			Version:  TokenVersion,
+			Type:     TypePersonal,
 			Issued:   ToTimestamp(issued),
 			Expires:  ToTimestamp(expires),
 			Grants:   "",

          
@@ 575,7 576,7 @@ func (s *Service) AccessTokenPOST(c echo
 
 	bt := BearerToken{
 		Version:  TokenVersion,
-		Type:     "OAUTH2",
+		Type:     TypeOAuth2,
 		Issued:   ToTimestamp(issued),
 		Expires:  ToTimestamp(expires),
 		Grants:   payload.Grants,