Webhook Discord

This commit is contained in:
2026-07-02 18:38:04 +02:00
parent 34fe0b461e
commit 3505bc149d
10 changed files with 171 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
import * as SecureStore from 'expo-secure-store';
import { AuthDb } from './database';
import { getConfiguredBackendRootUrl } from '../utils/backendUrl';
import { getAppInfoHeaders } from '../utils/appInfoHeaders';
const SESSION_KEY = 'greenlens_session_v3';
@@ -28,7 +29,7 @@ const authPost = async (path: string, body: object): Promise<{ userId: string; e
try {
response = await fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
headers: { 'Content-Type': 'application/json', ...getAppInfoHeaders() },
body: JSON.stringify(body),
});
} catch (e) {

View File

@@ -18,6 +18,7 @@ import { getAuthToken } from './userIdentityService';
import { mockBackendService } from './mockBackendService';
import { CareInfo, Language } from '../../types';
import { getConfiguredBackendRootUrl } from '../../utils/backendUrl';
import { getAppInfoHeaders } from '../../utils/appInfoHeaders';
const REQUEST_TIMEOUT_MS = 60000;
@@ -61,6 +62,7 @@ const makeRequest = async <T,>(
const headers: Record<string, string> = {
'Content-Type': 'application/json',
'Authorization': `Bearer ${options.token}`,
...getAppInfoHeaders(),
};
if (options.idempotencyKey) {
headers['Idempotency-Key'] = options.idempotencyKey;