mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 13:05:32 +09:00
fix(app): send current client locale on login/registration (#3412)
This commit is contained in:
1 parent
0ba15ee46a
commit
8a5d4a8bdb
1 file changed
+2
-2
@@ -9,7 +9,7 @@ import {type InstanceHTTPTarget, instanceRequest} from '@app/features/platform/t
|
|||||||
import {HttpError} from '@app/features/platform/types/EndpointError';
|
import {HttpError} from '@app/features/platform/types/EndpointError';
|
||||||
import {Logger} from '@app/features/platform/utils/AppLogger';
|
import {Logger} from '@app/features/platform/utils/AppLogger';
|
||||||
import {failureCode, ipAuthorizationRequiredResponseFromError} from '@app/features/platform/utils/ResponseInspection';
|
import {failureCode, ipAuthorizationRequiredResponseFromError} from '@app/features/platform/utils/ResponseInspection';
|
||||||
import UserSettings from '@app/features/user/state/UserSettings';
|
import {getCurrentOrDetectedLocale} from '@app/features/user/utils/LocaleUtils';
|
||||||
import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';
|
import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';
|
||||||
import type {ValueOf} from '@fluxer/constants/src/ValueOf';
|
import type {ValueOf} from '@fluxer/constants/src/ValueOf';
|
||||||
import type {
|
import type {
|
||||||
@@ -27,7 +27,7 @@ import type {AuthenticationResponseJSON, PublicKeyCredentialRequestOptionsJSON}
|
|||||||
|
|
||||||
const logger = new Logger('AuthService');
|
const logger = new Logger('AuthService');
|
||||||
const withAuthLocaleHeader = (headers?: Record<string, string>): Record<string, string> => ({
|
const withAuthLocaleHeader = (headers?: Record<string, string>): Record<string, string> => ({
|
||||||
'Accept-Language': UserSettings.locale,
|
'Accept-Language': getCurrentOrDetectedLocale(),
|
||||||
...(headers ?? {}),
|
...(headers ?? {}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user