diff --git a/Makefile b/Makefile index 52915d4..e4d9e0b 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ USER = gavaniwast all: clean dev dev: - NODE_ENV="development" docker compose up --build + NODE_ENV="development" docker-compose up --build check: NODE_ENV="check" docker-compose run back --build diff --git a/back/volume/src/auth/auth.controller.ts b/back/volume/src/auth/auth.controller.ts index 5103aba..e874f2a 100644 --- a/back/volume/src/auth/auth.controller.ts +++ b/back/volume/src/auth/auth.controller.ts @@ -66,7 +66,6 @@ export class AuthController { @Get('/verify') @UseGuards(AuthenticatedGuard) - @Redirect(`http://${frontHost}:${frontPort}`) async VerifyEmail (@Profile42() profile: Profile): Promise { const ftId: number = profile.id const user = await this.usersService.findUser(ftId) diff --git a/back/volume/src/auth/auth.service.ts b/back/volume/src/auth/auth.service.ts index 6c3a64b..df1e993 100644 --- a/back/volume/src/auth/auth.service.ts +++ b/back/volume/src/auth/auth.service.ts @@ -25,7 +25,6 @@ export class AuthService { async sendConfirmationEmail (user: User): Promise { user.authToken = Math.floor(10000 + Math.random() * 90000).toString() - console.log(`email sent to ${user.email}`) await this.usersService.save(user) try { await this.mailerService.sendMail({ diff --git a/front/volume/src/App.svelte b/front/volume/src/App.svelte index b8fa765..91e2566 100644 --- a/front/volume/src/App.svelte +++ b/front/volume/src/App.svelte @@ -167,90 +167,92 @@ > {:else if $store.twoFA === true && $store.isVerified === false} - + {:else} - + {#if !failedGameLogIn && !gamePlaying} + - {#if appState.includes(`${APPSTATE.CHANNELS}#`)} - {#key appState} + {#if appState.includes(`${APPSTATE.CHANNELS}#`)} + {#key appState} +
setAppState(APPSTATE.CHANNELS)} + on:keydown={() => setAppState(APPSTATE.CHANNELS)} + > + +
+ {/key} + {/if} + {#if appState.includes(APPSTATE.CHANNELS)} +
+ +
+ {/if} + {#if appState === APPSTATE.LEADERBOARD} +
+ +
+ {/if} + {#if appState === APPSTATE.FRIENDS} +
+ +
+ {/if} + {#if appState === APPSTATE.HISTORY} +
+ +
+ {/if} + {#if appState === APPSTATE.HISTORY_ID} +
setAppState(APPSTATE.PROFILE)} + on:keydown={() => setAppState(APPSTATE.PROFILE)} + > + +
+ {/if} + {#if appState === APPSTATE.PROFILE} +
+ setAppState(APPSTATE.HISTORY_ID)} /> +
+ {/if} + {#if appState === APPSTATE.PROFILE_ID}
setAppState(APPSTATE.CHANNELS)} - on:keydown={() => setAppState(APPSTATE.CHANNELS)} + on:click={() => + setAppState(APPSTATE.CHANNELS + "#" + selectedChannel.name)} + on:keydown={() => + setAppState(APPSTATE.CHANNELS + "#" + selectedChannel.name)} > - setAppState(APPSTATE.HISTORY_ID)} />
- {/key} - {/if} - {#if appState.includes(APPSTATE.CHANNELS)} -
- -
- {/if} - {#if appState === APPSTATE.LEADERBOARD} -
- -
- {/if} - {#if appState === APPSTATE.FRIENDS} -
- -
- {/if} - {#if appState === APPSTATE.HISTORY} -
- -
- {/if} - {#if appState === APPSTATE.HISTORY_ID} -
setAppState(APPSTATE.PROFILE)} - on:keydown={() => setAppState(APPSTATE.PROFILE)} - > - -
- {/if} - {#if appState === APPSTATE.PROFILE} -
- setAppState(APPSTATE.HISTORY_ID)} /> -
- {/if} - {#if appState === APPSTATE.PROFILE_ID} -
- setAppState(APPSTATE.CHANNELS + "#" + selectedChannel.name)} - on:keydown={() => - setAppState(APPSTATE.CHANNELS + "#" + selectedChannel.name)} - > - setAppState(APPSTATE.HISTORY_ID)} - /> -
+ {/if} {/if} {/if} diff --git a/front/volume/src/Auth.ts b/front/volume/src/Auth.ts index 8323321..7f0a131 100644 --- a/front/volume/src/Auth.ts +++ b/front/volume/src/Auth.ts @@ -31,13 +31,11 @@ export function login() { } export async function verify() { - if (get(store).twoFa === true) return; + if (get(store).isVerified === true) return; let email : string; await show_popup("Enter your preferred email adress:\n(defaults to 42 email)") email = get(content); - if (email == '') - return ; - if (email != 'ok') { + if (email !== undefined && email !== '' && email !== 'ok') { const response = await fetch(API_URL + "/log/email", { method: "POST", mode: "cors", @@ -47,22 +45,17 @@ export async function verify() { }) if (response.ok) {await show_popup("Email set",false)} else {await show_popup("Couldn't set Email",false); return } -} - console.log(API_URL) + } const response = await fetch(API_URL + "/log/verify", { method: "GET", mode: "cors", credentials: "include", }); - console.log(response.ok) if (response.ok) { - console.log("here") - await show_popup("We have sent you an email to verify your account. Check your mailbox!.", false); + await show_popup("We have sent you an email to verify your account. Check your mailbox!.", false); } else { - console.log("there") - await show_popup("Email doensn't seem valid", false);} - - + await show_popup("Email doensn't seem valid", false); + } } export function logout() { diff --git a/list b/list deleted file mode 100644 index 09cd609..0000000 --- a/list +++ /dev/null @@ -1,2 +0,0 @@ -- manage users on deleting channel -- delete \ No newline at end of file