email-confirm-as-success-page
This commit is contained in:
parent
e2d7710035
commit
26ab3bc7ad
|
@ -28,16 +28,15 @@ export const EmailConfirm = () => {
|
|||
}
|
||||
})
|
||||
|
||||
createEffect(() => {
|
||||
if (authError()) console.debug('[AuthModal.EmailConfirm] auth error: ', authError())
|
||||
})
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Show when={authError()}>
|
||||
<div class={styles.title}>{authError()}</div>
|
||||
<div class={styles.text}>
|
||||
<a href="/?modal=auth&mode=login">
|
||||
{/*TODO: temp solution, should be send link again */}
|
||||
{t('Enter')}
|
||||
</a>
|
||||
</div>
|
||||
<div class={styles.title}>{t('Error')}</div>
|
||||
<div class={styles.text}>{authError()}</div>
|
||||
</Show>
|
||||
<Show when={emailConfirmed()}>
|
||||
<div class={styles.title}>{t('Hooray! Welcome!')}</div>
|
||||
|
|
|
@ -38,8 +38,13 @@
|
|||
a {
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.githubAuth:hover {
|
||||
.facebook,
|
||||
.google,
|
||||
.vk,
|
||||
.telegram {
|
||||
border: none;
|
||||
}
|
||||
.github:hover {
|
||||
img {
|
||||
filter: invert(1);
|
||||
}
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
import { For } from 'solid-js'
|
||||
|
||||
import { useLocalize } from '../../../context/localize'
|
||||
import { useSession } from '../../../context/session'
|
||||
import { Icon } from '../../_shared/Icon'
|
||||
|
||||
import styles from './SocialProviders.module.scss'
|
||||
|
||||
type Provider = 'facebook' | 'google' | 'github' // 'vk' | 'telegram'
|
||||
export const PROVIDERS = ['facebook', 'google', 'github'] // 'vk' | 'telegram'
|
||||
|
||||
export const SocialProviders = () => {
|
||||
const { t } = useLocalize()
|
||||
|
@ -16,15 +18,13 @@ export const SocialProviders = () => {
|
|||
<div class={styles.container}>
|
||||
<div class={styles.text}>{t('or sign in with social networks')}</div>
|
||||
<div class={styles.social}>
|
||||
<a href="#" onClick={(_e) => oauth('google')}>
|
||||
<Icon name={'google'} />
|
||||
</a>
|
||||
<a href="#" onClick={(_e) => oauth('facebook')}>
|
||||
<Icon name={'facebook'} />
|
||||
</a>
|
||||
<a href="#" class={styles.githubAuth} onClick={(_e) => oauth('github')}>
|
||||
<Icon name="github" />
|
||||
</a>
|
||||
<For each={PROVIDERS}>
|
||||
{(provider) => (
|
||||
<a href="#" class={styles[provider]} onClick={(_e) => oauth(provider)}>
|
||||
<Icon name={provider} />
|
||||
</a>
|
||||
)}
|
||||
</For>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
|
|
@ -64,7 +64,7 @@ export const NotificationGroup = (props: NotificationGroupProps) => {
|
|||
|
||||
return (
|
||||
<>
|
||||
<For each={props.notifications || []}>
|
||||
<For each={props.notifications}>
|
||||
{(n: Group) => (
|
||||
<>
|
||||
{t(reactionsCaption(n.id), { commentsCount: n.reactions.length })}{' '}
|
||||
|
|
|
@ -92,12 +92,8 @@ export const SessionProvider = (props: {
|
|||
const { searchParams, changeSearchParams } = useRouter()
|
||||
const [configuration, setConfig] = createSignal<ConfigType>(defaultConfig)
|
||||
const authorizer = createMemo(() => new Authorizer(configuration()))
|
||||
|
||||
createEffect(() => {
|
||||
if (authorizer()) {
|
||||
}
|
||||
})
|
||||
const [oauthState, setOauthState] = createSignal<string>()
|
||||
|
||||
// handle callback's redirect_uri
|
||||
createEffect(async () => {
|
||||
// oauth
|
||||
|
@ -109,7 +105,7 @@ export const SessionProvider = (props: {
|
|||
: ['openid', 'profile', 'email']
|
||||
if (scope) console.info(`[context.session] scope: ${scope}`)
|
||||
const url = searchParams()?.redirect_uri || searchParams()?.redirectURL || window.location.href
|
||||
setConfig((c: ConfigType) => ({ ...c, redirectURL: url })) // .split('?')[0]
|
||||
setConfig((c: ConfigType) => ({ ...c, redirectURL: url.split('?')[0] }))
|
||||
changeSearchParams({ mode: 'confirm-email', modal: 'auth' }, true)
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue
Block a user