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