Hotfix/remove state params after login (#443)
* hide autofill in profilr settings * fix Image width * Remove state search params after login * fix biome
This commit is contained in:
parent
cca858dadf
commit
36fff73af6
|
@ -22,6 +22,7 @@ img {
|
||||||
.articleContent {
|
.articleContent {
|
||||||
img:not([data-disable-lightbox='true']) {
|
img:not([data-disable-lightbox='true']) {
|
||||||
cursor: zoom-in;
|
cursor: zoom-in;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -227,6 +227,7 @@ export const HeaderAuth = (props: Props) => {
|
||||||
<Show
|
<Show
|
||||||
when={isAuthenticatedControlsVisible()}
|
when={isAuthenticatedControlsVisible()}
|
||||||
fallback={
|
fallback={
|
||||||
|
<Show when={!isAuthenticated()}>
|
||||||
<div class={clsx(styles.userControlItem, styles.userControlItemVerbose, 'loginbtn')}>
|
<div class={clsx(styles.userControlItem, styles.userControlItemVerbose, 'loginbtn')}>
|
||||||
<a href="?m=auth&mode=login">
|
<a href="?m=auth&mode=login">
|
||||||
<span class={styles.textLabel}>{t('Enter')}</span>
|
<span class={styles.textLabel}>{t('Enter')}</span>
|
||||||
|
@ -234,6 +235,7 @@ export const HeaderAuth = (props: Props) => {
|
||||||
{/*<Icon name="user-default" class={clsx(styles.icon, styles.iconHover)} />*/}
|
{/*<Icon name="user-default" class={clsx(styles.icon, styles.iconHover)} />*/}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
</Show>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Show when={!isSaveButtonVisible()}>
|
<Show when={!isSaveButtonVisible()}>
|
||||||
|
|
|
@ -264,6 +264,7 @@ export const ProfileSettings = () => {
|
||||||
type="text"
|
type="text"
|
||||||
name="username"
|
name="username"
|
||||||
id="username"
|
id="username"
|
||||||
|
autocomplete="one-time-code"
|
||||||
placeholder={t('Name')}
|
placeholder={t('Name')}
|
||||||
onInput={(event) => updateFormField('name', event.currentTarget.value)}
|
onInput={(event) => updateFormField('name', event.currentTarget.value)}
|
||||||
value={form.name}
|
value={form.name}
|
||||||
|
@ -289,6 +290,7 @@ export const ProfileSettings = () => {
|
||||||
type="text"
|
type="text"
|
||||||
name="user-address"
|
name="user-address"
|
||||||
id="user-address"
|
id="user-address"
|
||||||
|
autocomplete="one-time-code2"
|
||||||
onInput={(event) => updateFormField('slug', event.currentTarget.value)}
|
onInput={(event) => updateFormField('slug', event.currentTarget.value)}
|
||||||
value={form.slug}
|
value={form.slug}
|
||||||
ref={(el) => (slugInputRef.current = el)}
|
ref={(el) => (slugInputRef.current = el)}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import type { Accessor, JSX, Resource } from 'solid-js'
|
import type { Accessor, JSX, Resource } from 'solid-js'
|
||||||
import type { AuthModalSource } from '../components/Nav/AuthModal/types'
|
import type { AuthModalSearchParams, AuthModalSource } from '../components/Nav/AuthModal/types'
|
||||||
import type { Author } from '../graphql/schema/core.gen'
|
import type { Author } from '../graphql/schema/core.gen'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -29,7 +29,6 @@ import {
|
||||||
|
|
||||||
import { inboxClient } from '../graphql/client/chat'
|
import { inboxClient } from '../graphql/client/chat'
|
||||||
import { apiClient } from '../graphql/client/core'
|
import { apiClient } from '../graphql/client/core'
|
||||||
import { notifierClient } from '../graphql/client/notifier'
|
|
||||||
import { useRouter } from '../stores/router'
|
import { useRouter } from '../stores/router'
|
||||||
import { showModal } from '../stores/ui'
|
import { showModal } from '../stores/ui'
|
||||||
import { addAuthors } from '../stores/zine/authors'
|
import { addAuthors } from '../stores/zine/authors'
|
||||||
|
@ -136,6 +135,7 @@ export const SessionProvider = (props: {
|
||||||
|
|
||||||
const [isSessionLoaded, setIsSessionLoaded] = createSignal(false)
|
const [isSessionLoaded, setIsSessionLoaded] = createSignal(false)
|
||||||
const [authError, setAuthError] = createSignal('')
|
const [authError, setAuthError] = createSignal('')
|
||||||
|
const { clearSearchParams } = useRouter<AuthModalSearchParams>()
|
||||||
|
|
||||||
// Function to load session data
|
// Function to load session data
|
||||||
const sessionData = async () => {
|
const sessionData = async () => {
|
||||||
|
@ -143,7 +143,7 @@ export const SessionProvider = (props: {
|
||||||
const s: ApiResponse<AuthToken> = await authorizer().getSession()
|
const s: ApiResponse<AuthToken> = await authorizer().getSession()
|
||||||
if (s?.data) {
|
if (s?.data) {
|
||||||
console.info('[context.session] loading session', s)
|
console.info('[context.session] loading session', s)
|
||||||
|
clearSearchParams()
|
||||||
// Set session expiration time in local storage
|
// Set session expiration time in local storage
|
||||||
const expires_at = new Date(Date.now() + s.data.expires_in * 1000)
|
const expires_at = new Date(Date.now() + s.data.expires_in * 1000)
|
||||||
localStorage.setItem('expires_at', `${expires_at.getTime()}`)
|
localStorage.setItem('expires_at', `${expires_at.getTime()}`)
|
||||||
|
@ -379,6 +379,7 @@ export const SessionProvider = (props: {
|
||||||
}
|
}
|
||||||
|
|
||||||
const isAuthenticated = createMemo(() => Boolean(author()))
|
const isAuthenticated = createMemo(() => Boolean(author()))
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
loadSession,
|
loadSession,
|
||||||
requireAuthentication,
|
requireAuthentication,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user