diff options
Diffstat (limited to 'internal/oauth/clientstore.go')
-rw-r--r-- | internal/oauth/clientstore.go | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/internal/oauth/clientstore.go b/internal/oauth/clientstore.go index 2e7e0ae88..a642f6cfa 100644 --- a/internal/oauth/clientstore.go +++ b/internal/oauth/clientstore.go @@ -39,10 +39,8 @@ func NewClientStore(db db.Basic) oauth2.ClientStore { } func (cs *clientStore) GetByID(ctx context.Context, clientID string) (oauth2.ClientInfo, error) { - poc := &Client{ - ID: clientID, - } - if err := cs.db.GetByID(clientID, poc); err != nil { + poc := &Client{} + if err := cs.db.GetByID(ctx, clientID, poc); err != nil { return nil, err } return models.New(poc.ID, poc.Secret, poc.Domain, poc.UserID), nil @@ -55,19 +53,19 @@ func (cs *clientStore) Set(ctx context.Context, id string, cli oauth2.ClientInfo Domain: cli.GetDomain(), UserID: cli.GetUserID(), } - return cs.db.UpdateByID(id, poc) + return cs.db.Put(ctx, poc) } func (cs *clientStore) Delete(ctx context.Context, id string) error { poc := &Client{ ID: id, } - return cs.db.DeleteByID(id, poc) + return cs.db.DeleteByID(ctx, id, poc) } // Client is a handy little wrapper for typical oauth client details type Client struct { - ID string `pg:"type:CHAR(26),pk,notnull"` + ID string `bun:"type:CHAR(26),pk,notnull"` Secret string Domain string UserID string |