(credentials: AuthCredentials)
| 719 | } |
| 720 | |
| 721 | private async clerkLogout(credentials: AuthCredentials): Promise<void> { |
| 722 | const formData = new URLSearchParams() |
| 723 | formData.append("_is_native", "1") |
| 724 | |
| 725 | const response = await fetch(`${getClerkBaseUrl()}/v1/client/sessions/${credentials.sessionId}/remove`, { |
| 726 | method: "POST", |
| 727 | headers: { |
| 728 | "Content-Type": "application/x-www-form-urlencoded", |
| 729 | Authorization: `Bearer ${credentials.clientToken}`, |
| 730 | "User-Agent": this.userAgent(), |
| 731 | }, |
| 732 | body: formData.toString(), |
| 733 | signal: AbortSignal.timeout(10000), |
| 734 | }) |
| 735 | |
| 736 | if (!response.ok) { |
| 737 | throw new Error(`HTTP ${response.status}: ${response.statusText}`) |
| 738 | } |
| 739 | } |
| 740 | |
| 741 | private userAgent(): string { |
| 742 | return getUserAgent(this.context) |
no test coverage detected