fix linter, cleanup

This commit is contained in:
Lurkars 2021-10-21 16:53:24 +02:00
parent 6832fe4990
commit 78e0d1bead
2 changed files with 8 additions and 13 deletions

View File

@ -215,18 +215,13 @@ class ConnectionManager {
} }
public async anonymousLogin(isBenchmark: boolean = false): Promise<void> { public async anonymousLogin(isBenchmark: boolean = false): Promise<void> {
try { const data = await Axios.post(`${PUSHER_URL}/anonymLogin`).then((res) => res.data);
const data = await Axios.post(`${PUSHER_URL}/anonymLogin`).then((res) => res.data); this.localUser = new LocalUser(data.userUuid, []);
this.localUser = new LocalUser(data.userUuid, []); this.authToken = data.authToken;
this.authToken = data.authToken; if (!isBenchmark) {
if (!isBenchmark) { // In benchmark, we don't have a local storage.
// In benchmark, we don't have a local storage. localUserStore.saveUser(this.localUser);
localUserStore.saveUser(this.localUser); localUserStore.setAuthToken(this.authToken);
localUserStore.setAuthToken(this.authToken);
}
} catch (error) {
// anonymous login failed (through 403 DISABLE_ANONYMOUS)
this.loadOpenIDScreen();
} }
} }

View File

@ -89,7 +89,7 @@ export class MapController extends BaseController {
const mapDetails = await adminApi.fetchMapDetails(query.playUri as string, userId); const mapDetails = await adminApi.fetchMapDetails(query.playUri as string, userId);
if (isMapDetailsData(mapDetails) && DISABLE_ANONYMOUS) { if (isMapDetailsData(mapDetails) && DISABLE_ANONYMOUS) {
(mapDetails as MapDetailsData).authenticationMandatory = true; mapDetails.authenticationMandatory = true;
} }
res.writeStatus("200 OK"); res.writeStatus("200 OK");