MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / WaitForAuthorization

Method WaitForAuthorization

internal/auth/kimi/kimi.go:65–75  ·  view source on GitHub ↗

WaitForAuthorization polls for user authorization and returns the auth bundle.

(ctx context.Context, deviceCode *DeviceCodeResponse)

Source from the content-addressed store, hash-verified

63
64// WaitForAuthorization polls for user authorization and returns the auth bundle.
65func (k *KimiAuth) WaitForAuthorization(ctx context.Context, deviceCode *DeviceCodeResponse) (*KimiAuthBundle, error) {
66 tokenData, err := k.deviceClient.PollForToken(ctx, deviceCode)
67 if err != nil {
68 return nil, err
69 }
70
71 return &KimiAuthBundle{
72 TokenData: tokenData,
73 DeviceID: k.deviceClient.deviceID,
74 }, nil
75}
76
77// CreateTokenStorage creates a new KimiTokenStorage from auth bundle.
78func (k *KimiAuth) CreateTokenStorage(bundle *KimiAuthBundle) *KimiTokenStorage {

Callers 2

RequestKimiTokenMethod · 0.95
LoginMethod · 0.95

Calls 1

PollForTokenMethod · 0.80

Tested by

no test coverage detected