| 157 | } |
| 158 | |
| 159 | func getTokenRefresher(httpClient connect.HTTPClient, email, password, url string) func(ctx context.Context) (string, error) { |
| 160 | // Create a separate auth client without interceptors to avoid circular dependencies |
| 161 | authClient := v1connect.NewAuthServiceClient(httpClient, url) |
| 162 | return func(ctx context.Context) (string, error) { |
| 163 | req := connect.NewRequest(&v1pb.LoginRequest{ |
| 164 | Email: email, |
| 165 | Password: password, |
| 166 | }) |
| 167 | |
| 168 | resp, err := authClient.Login(ctx, req) |
| 169 | if err != nil { |
| 170 | return "", errors.Wrapf(err, "failed to login") |
| 171 | } |
| 172 | |
| 173 | return resp.Msg.Token, nil |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | func (c *client) checkRelease(ctx context.Context, r *v1pb.CheckReleaseRequest) (*v1pb.CheckReleaseResponse, error) { |
| 178 | resp, err := c.releaseClient.CheckRelease(ctx, connect.NewRequest(r)) |