Skip to content

Commit 552c26c

Browse files
authored
Merge pull request #2 from alexhokl/uuid-newv4
Adapted to the change of signature of uuid.NewV4()
2 parents e44a7c9 + 318fc27 commit 552c26c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

token.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ func (rs *TokenStore) Create(info oauth2.TokenInfo) (err error) {
5050
if code := info.GetCode(); code != "" {
5151
pipe.Set(code, jv, info.GetCodeExpiresIn())
5252
} else {
53-
basicID := uuid.NewV4().String()
53+
basicID, uerr := uuid.NewV4()
54+
if uerr != nil {
55+
err = uerr
56+
return
57+
}
58+
basicIDStr := basicID.String()
5459
aexp := info.GetAccessExpiresIn()
5560
rexp := aexp
5661

@@ -59,10 +64,10 @@ func (rs *TokenStore) Create(info oauth2.TokenInfo) (err error) {
5964
if aexp.Seconds() > rexp.Seconds() {
6065
aexp = rexp
6166
}
62-
pipe.Set(refresh, basicID, rexp)
67+
pipe.Set(refresh, basicIDStr, rexp)
6368
}
64-
pipe.Set(info.GetAccess(), basicID, aexp)
65-
pipe.Set(basicID, jv, rexp)
69+
pipe.Set(info.GetAccess(), basicIDStr, aexp)
70+
pipe.Set(basicIDStr, jv, rexp)
6671
}
6772

6873
if _, verr := pipe.Exec(); verr != nil {

0 commit comments

Comments
 (0)