Skip to content

Commit

Permalink
fix: use json tag for token store item
Browse files Browse the repository at this point in the history
Signed-off-by: Gabor Boros <[email protected]>
  • Loading branch information
gabor-boros committed Feb 23, 2023
1 parent 8a7677a commit 86f519b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file.

## [0.1.1] - 2023-02-23

**Bug Fixes**

- Use json tag for token store item ([78ed7cd](https://github.com/gabor-boros/go-oauth2-arangodb/commit/78ed7cd5cc65445a39aa1cef1bfc1ef2ae385e39))

## [0.1.0] - 2023-02-23

**Features**
Expand Down
16 changes: 8 additions & 8 deletions token_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ func WithTokenStoreDatabase(db arangoDriver.Database) TokenStoreOption {

// TokenStoreItem data item
type TokenStoreItem struct {
Key string `db:"_key"`
Code string `db:"code"`
Access string `db:"access_token"`
Refresh string `db:"refresh_token"`
Data []byte `db:"data"`
CreatedAt time.Time `db:"created_at"`
ExpiresAt time.Time `db:"expires_at"`
Key string `json:"_key,omitempty"`
Code string `json:"code"`
Access string `json:"access_token"`
Refresh string `json:"refresh_token"`
Data []byte `json:"data"`
CreatedAt time.Time `json:"created_at"`
ExpiresAt time.Time `json:"expires_at"`
}

// TokenStore is a data struct that stores oauth2 client information.
Expand Down Expand Up @@ -97,7 +97,7 @@ func (s *TokenStore) removeByQuery(ctx context.Context, query string, bindVars m
return cursor.Close()
}

// Create creates a new client in the store.
// Create creates a new token in the store.
func (s *TokenStore) Create(ctx context.Context, info oauth2.TokenInfo) error {
data, err := json.Marshal(info)
if err != nil {
Expand Down

0 comments on commit 86f519b

Please sign in to comment.