diff --git a/client/src/app/core/core-services/auth.service.ts b/client/src/app/core/core-services/auth.service.ts index 0b2d2004e..e745877a0 100644 --- a/client/src/app/core/core-services/auth.service.ts +++ b/client/src/app/core/core-services/auth.service.ts @@ -10,6 +10,12 @@ import { HttpService } from './http.service'; import { OpenSlidesService } from './openslides.service'; import { StorageService } from './storage.service'; +interface LoginData { + username: string; + password: string; + cookies?: boolean; +} + /** * Authenticates an OpenSlides user with username and password */ @@ -47,11 +53,14 @@ export class AuthService { earlySuccessCallback: () => void ): Promise { if (authType === 'default') { - const user = { + const data: LoginData = { username: username, password: password }; - const response = await this.http.post(environment.urlPrefix + '/users/login/', user); + if (!navigator.cookieEnabled) { + data.cookies = false; + } + const response = await this.http.post(environment.urlPrefix + '/users/login/', data); earlySuccessCallback(); await this.OpenSlides.shutdown(); await this.operator.setWhoAmI(response);