@@ -166,7 +162,7 @@ export const AuthorCard = (props: Props) => {
)
@@ -242,7 +238,7 @@ export const AuthorCard = (props: Props) => {
}
/>
diff --git a/src/components/Author/Userpic/Userpic.tsx b/src/components/Author/Userpic/Userpic.tsx
index 24a465db..bcebb25e 100644
--- a/src/components/Author/Userpic/Userpic.tsx
+++ b/src/components/Author/Userpic/Userpic.tsx
@@ -22,7 +22,7 @@ export const Userpic = (props: Props) => {
const letters = () => {
if (!props.name) return
const names = props.name ? props.name.split(' ') : []
- return names[0][0] + '.' + (names.length > 1 ? names[1][0] : '') + '.'
+ return names[0][0 ?? names[0][0]] + '.' + (names.length > 1 ? names[1][0] + '.' : '')
}
const avatarSize = createMemo(() => {
diff --git a/src/components/Nav/AuthModal/EmailConfirm.tsx b/src/components/Nav/AuthModal/EmailConfirm.tsx
index 382b4e8f..c67bc74a 100644
--- a/src/components/Nav/AuthModal/EmailConfirm.tsx
+++ b/src/components/Nav/AuthModal/EmailConfirm.tsx
@@ -28,7 +28,7 @@ export const EmailConfirm = () => {
onMount(async () => {
const token = searchParams().token
try {
- await confirmEmail(token)
+ await confirmEmail({ token })
} catch (error) {
if (error instanceof ApiError) {
if (error.code === 'token_expired') {
diff --git a/src/components/Nav/AuthModal/ForgotPasswordForm.tsx b/src/components/Nav/AuthModal/ForgotPasswordForm.tsx
index dc13fa32..ff2b5176 100644
--- a/src/components/Nav/AuthModal/ForgotPasswordForm.tsx
+++ b/src/components/Nav/AuthModal/ForgotPasswordForm.tsx
@@ -34,6 +34,8 @@ export const ForgotPasswordForm = () => {
const authFormRef: { current: HTMLFormElement } = { current: null }
+ const [message, setMessage] = createSignal
('')
+
const handleSubmit = async (event: Event) => {
event.preventDefault()
@@ -61,11 +63,14 @@ export const ForgotPasswordForm = () => {
}
setIsSubmitting(true)
-
try {
- const response = await authorizer().forgotPassword({ email: email() })
+ const response = await authorizer().forgotPassword({
+ email: email(),
+ redirect_uri: window.location.href + '&success=1', // FIXME: redirect to success page accepting confirmation code
+ })
if (response) {
console.debug(response)
+ if (response.message) setMessage(response.message)
}
} catch (error) {
if (error instanceof ApiError && error.code === 'user_not_found') {
@@ -86,7 +91,9 @@ export const ForgotPasswordForm = () => {
>
{t('Forgot password?')}
-
{t('Everything is ok, please give us your email address')}
+
+ {t(message()) || t('Everything is ok, please give us your email address')}
+