[#75] added option to test s3 connection and send test emails

This commit is contained in:
Gani Georgiev
2022-08-21 14:30:36 +03:00
parent 3f4f4cf031
commit 587cfc335c
49 changed files with 1539 additions and 838 deletions

View File

@@ -1,4 +1,5 @@
<script>
import PocketBase from "pocketbase";
import ApiClient from "@/utils/ApiClient";
import CommonHelper from "@/utils/CommonHelper";
import FullPage from "@/components/base/FullPage.svelte";
@@ -19,8 +20,11 @@
isLoading = true;
// init a custom client to avoid interfering with the admin state
const client = new PocketBase(import.meta.env.PB_BACKEND_URL);
try {
await ApiClient.users.confirmEmailChange(params?.token, password);
await client.users.confirmEmailChange(params?.token, password);
success = true;
} catch (err) {
ApiClient.errorResponseHandler(err);
@@ -45,13 +49,13 @@
</button>
{:else}
<form on:submit|preventDefault={submit}>
<div class="content txt-center m-b-sm">
<h4 class="m-b-xs">
<div class="content txt-center m-b-base">
<h5>
Type your password to confirm changing your email address
{#if newEmail}
to <strong class="txt-nowrap">{newEmail}</strong>
{/if}
</h4>
</h5>
</div>
<Field class="form-field required" name="password" let:uniqueId>

View File

@@ -1,4 +1,5 @@
<script>
import PocketBase from "pocketbase";
import ApiClient from "@/utils/ApiClient";
import CommonHelper from "@/utils/CommonHelper";
import FullPage from "@/components/base/FullPage.svelte";
@@ -20,8 +21,11 @@
isLoading = true;
// init a custom client to avoid interfering with the admin state
const client = new PocketBase(import.meta.env.PB_BACKEND_URL);
try {
await ApiClient.users.confirmPasswordReset(params?.token, newPassword, newPasswordConfirm);
await client.users.confirmPasswordReset(params?.token, newPassword, newPasswordConfirm);
success = true;
} catch (err) {
ApiClient.errorResponseHandler(err);
@@ -46,13 +50,13 @@
</button>
{:else}
<form on:submit|preventDefault={submit}>
<div class="content txt-center m-b-sm">
<h4 class="m-b-xs">
<div class="content txt-center m-b-base">
<h5>
Reset your user password
{#if email}
for <strong>{email}</strong>
{/if}
</h4>
</h5>
</div>
<Field class="form-field required" name="password" let:uniqueId>

View File

@@ -1,5 +1,5 @@
<script>
import ApiClient from "@/utils/ApiClient";
import PocketBase from "pocketbase";
import FullPage from "@/components/base/FullPage.svelte";
export let params;
@@ -12,11 +12,13 @@
async function send() {
isLoading = true;
// init a custom client to avoid interfering with the admin state
const client = new PocketBase(import.meta.env.PB_BACKEND_URL);
try {
await ApiClient.users.confirmVerification(params?.token);
await client.users.confirmVerification(params?.token);
success = true;
} catch (err) {
console.warn(err);
success = false;
}