Merge pull request #5546 from FinnStutzenstein/checkForCookies
Added missing client part for cookie checking on login
This commit is contained in:
commit
12e6090fa7
@ -10,6 +10,12 @@ import { HttpService } from './http.service';
|
|||||||
import { OpenSlidesService } from './openslides.service';
|
import { OpenSlidesService } from './openslides.service';
|
||||||
import { StorageService } from './storage.service';
|
import { StorageService } from './storage.service';
|
||||||
|
|
||||||
|
interface LoginData {
|
||||||
|
username: string;
|
||||||
|
password: string;
|
||||||
|
cookies?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Authenticates an OpenSlides user with username and password
|
* Authenticates an OpenSlides user with username and password
|
||||||
*/
|
*/
|
||||||
@ -47,11 +53,14 @@ export class AuthService {
|
|||||||
earlySuccessCallback: () => void
|
earlySuccessCallback: () => void
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (authType === 'default') {
|
if (authType === 'default') {
|
||||||
const user = {
|
const data: LoginData = {
|
||||||
username: username,
|
username: username,
|
||||||
password: password
|
password: password
|
||||||
};
|
};
|
||||||
const response = await this.http.post<WhoAmI>(environment.urlPrefix + '/users/login/', user);
|
if (!navigator.cookieEnabled) {
|
||||||
|
data.cookies = false;
|
||||||
|
}
|
||||||
|
const response = await this.http.post<WhoAmI>(environment.urlPrefix + '/users/login/', data);
|
||||||
earlySuccessCallback();
|
earlySuccessCallback();
|
||||||
await this.OpenSlides.shutdown();
|
await this.OpenSlides.shutdown();
|
||||||
await this.operator.setWhoAmI(response);
|
await this.operator.setWhoAmI(response);
|
||||||
|
Loading…
Reference in New Issue
Block a user