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

Method GetTokenByToken

internal/services/token.go:48–55  ·  view source on GitHub ↗
(ctx context.Context, token string)

Source from the content-addressed store, hash-verified

46}
47
48func (s *TokenService) GetTokenByToken(ctx context.Context, token string) (*Token, error) {
49 var tokenObj Token
50 err := s.tokenCollection.FindOne(ctx, bson.M{"token": token}).Decode(&tokenObj)
51 if err != nil {
52 return nil, err
53 }
54 return &tokenObj, nil
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})

Callers 4

TestAuthServerFunction · 0.95
TestTokenService_CRUDFunction · 0.80
RefreshTokenMethod · 0.80
LogoutMethod · 0.80

Calls

no outgoing calls

Tested by 2

TestAuthServerFunction · 0.76
TestTokenService_CRUDFunction · 0.64