Skip to content

Commit

Permalink
fix(front): add a verification with the password by trying to connect…
Browse files Browse the repository at this point in the history
… with password
  • Loading branch information
BaptTF committed Apr 30, 2024
1 parent 41830f6 commit 8f28589
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions frontend/src/routes/comptoir/c/transactions/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
<script lang="ts">
import { goto } from '$app/navigation';
import Pin from '$lib/components/borne/pin.svelte';
import Transactions from '$lib/components/comptoir/transactions.svelte';
import ReadCard from '$lib/components/readCard.svelte';
import { open_caisse, open_door, open_ventilo } from '$lib/local/local';
import NewRefill from '$lib/components/comptoir/newRefill.svelte';
import { authApi } from '$lib/requests/requests';
import ChangePassword from '$lib/components/comptoir/changePassword.svelte';
import Password from '$lib/components/password.svelte';
import type { ConnectPasswordRequest } from '$lib/api';
import { transactionsApi } from '$lib/requests/requests';
import type { TransactionItem } from '$lib/api';
import TransactionsItems from '$lib/components/comptoir/transactionsItems.svelte';
function reset() {
Expand All @@ -28,7 +26,7 @@
let askForPassword = false;
let newRefill = false;
let changePassword = false;
let info: ConnectPasswordRequest;
function close() {
newRefill = false;
}
Expand All @@ -47,7 +45,15 @@
}
const go_admin_panel = (card_id: string, password: string) => {
goto('/panel');
info = {
card_id: card_id,
password: password,
}
authApi()
.connectPassword(info, { withCredentials: true })
.then(() => {
goto('/panel');
});
};
let showTransactionItems = false;
Expand Down

0 comments on commit 8f28589

Please sign in to comment.