fix: typo isAuthenticate -> isAuthenticated

This commit is contained in:
starnakin 2024-02-13 14:07:53 +01:00
parent d773859e04
commit 94a4c4cdf8
9 changed files with 10 additions and 10 deletions

View File

@ -80,7 +80,7 @@ class Client
* The only right way to determine is the user is logged * The only right way to determine is the user is logged
* @returns {Promise<Boolean>} * @returns {Promise<Boolean>}
*/ */
async isAuthenticate() async isAuthenticated()
{ {
if (this._logged == undefined) if (this._logged == undefined)
this._logged = await this._test_logged(); this._logged = await this._test_logged();

View File

@ -23,7 +23,7 @@ class MatchMaking
*/ */
async start(receive_func, disconnect_func, mode) async start(receive_func, disconnect_func, mode)
{ {
if (!await this.client.isAuthenticate()) if (!await this.client.isAuthenticated())
return null; return null;
let url = `${window.location.protocol[4] === 's' ? 'wss' : 'ws'}://${window.location.host}/ws/matchmaking/${mode}`; let url = `${window.location.protocol[4] === 's' ? 'wss' : 'ws'}://${window.location.host}/ws/matchmaking/${mode}`;

View File

@ -120,7 +120,7 @@ class Tourmanent
*/ */
async join(receive_func, disconnect_func) async join(receive_func, disconnect_func)
{ {
if (!await this.client.isAuthenticate()) if (!await this.client.isAuthenticated())
return null; return null;
let url = `${window.location.protocol[4] === 's' ? 'wss' : 'ws'}://${window.location.host}/ws/tournaments/${this.id}`; let url = `${window.location.protocol[4] === 's' ? 'wss' : 'ws'}://${window.location.host}/ws/tournaments/${this.id}`;

View File

@ -152,7 +152,7 @@ document.addEventListener("DOMContentLoaded", async () => {
document.querySelector(`#languageSelector > [value=${lang.chosenLang}]`) document.querySelector(`#languageSelector > [value=${lang.chosenLang}]`)
?.classList.add('active'); ?.classList.add('active');
await client.isAuthenticate(); await client.isAuthenticated();
router(location.pathname); router(location.pathname);
document.querySelector('a[href=\'' + location.pathname + '\']')?.classList.add('active'); document.querySelector('a[href=\'' + location.pathname + '\']')?.classList.add('active');
}); });

View File

@ -44,7 +44,7 @@ export default class extends AbstractView {
async blockButton() { async blockButton() {
// Block option // Block option
if (await client.isAuthenticate() === false) if (await client.isAuthenticated() === false)
return; return;
if (client.me.id != this.user_id) { if (client.me.id != this.user_id) {
@ -72,7 +72,7 @@ export default class extends AbstractView {
} }
async friendButton() { async friendButton() {
if (await client.isAuthenticate() === false) if (await client.isAuthenticated() === false)
return; return;
if (client.me.id != this.user_id) { if (client.me.id != this.user_id) {

View File

@ -21,7 +21,7 @@ export default class extends AbstractView {
async postInit() { async postInit() {
let logged = await client.isAuthenticate(); let logged = await client.isAuthenticated();
let profiles = await client.profiles.all(); let profiles = await client.profiles.all();
//console.log(client.notice.data); //console.log(client.notice.data);

View File

@ -36,7 +36,7 @@ export default class extends AbstractAuthenticatedView
let response_data = await client.account.delete(current_password); let response_data = await client.account.delete(current_password);
console.log(await client.isAuthenticate()) console.log(await client.isAuthenticated())
if (response_data === null || response_data === "user deleted") if (response_data === null || response_data === "user deleted")
{ {
navigateTo("/login"); navigateTo("/login");

View File

@ -8,7 +8,7 @@ export default class extends AbstractRedirectView{
async redirect() async redirect()
{ {
if (await client.isAuthenticate() === false) if (await client.isAuthenticated() === false)
{ {
navigateTo(this.redirect_url); navigateTo(this.redirect_url);
return 1; return 1;

View File

@ -8,7 +8,7 @@ export default class extends AbstractRedirectView{
async redirect() async redirect()
{ {
if (await client.isAuthenticate() === false) if (await client.isAuthenticated() === false)
return 0; return 0;
navigateTo(this.redirect_url); navigateTo(this.redirect_url);
return 1; return 1;