MCPcopy Create free account
hub / github.com/PaperDebugger/paperdebugger / UpdateToken

Method UpdateToken

internal/services/token.go:57–63  ·  view source on GitHub ↗
(ctx context.Context, token *Token)

Source from the content-addressed store, hash-verified

55}
56
57func (s *TokenService) UpdateToken(ctx context.Context, token *Token) (*Token, error) {
58 _, err := s.tokenCollection.UpdateOne(ctx, bson.M{"_id": token.ID}, bson.M{"$set": token})
59 if err != nil {
60 return nil, err
61 }
62 return token, nil
63}
64
65func (s *TokenService) DeleteToken(ctx context.Context, token *Token) error {
66 _, err := s.tokenCollection.DeleteOne(ctx, bson.M{"_id": token.ID})

Callers 3

TestAuthServerFunction · 0.95
TestTokenService_CRUDFunction · 0.80
RefreshTokenMethod · 0.80

Calls

no outgoing calls

Tested by 2

TestAuthServerFunction · 0.76
TestTokenService_CRUDFunction · 0.64