force enable oauth
This commit is contained in:
@@ -13,7 +13,6 @@ import {
|
|||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
import {USE_OAUTH} from '#/lib/app-info'
|
|
||||||
import {useRequestNotificationsPermission} from '#/lib/notifications/notifications'
|
import {useRequestNotificationsPermission} from '#/lib/notifications/notifications'
|
||||||
import {isNetworkError} from '#/lib/strings/errors'
|
import {isNetworkError} from '#/lib/strings/errors'
|
||||||
import {cleanError} from '#/lib/strings/errors'
|
import {cleanError} from '#/lib/strings/errors'
|
||||||
@@ -54,7 +53,7 @@ interface LoginFormProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function LoginForm(props: LoginFormProps) {
|
export function LoginForm(props: LoginFormProps) {
|
||||||
if (USE_OAUTH) {
|
if (true) {
|
||||||
return <OAuthLoginForm {...props} />
|
return <OAuthLoginForm {...props} />
|
||||||
} else {
|
} else {
|
||||||
return <LoginFormInner {...props} />
|
return <LoginFormInner {...props} />
|
||||||
@@ -76,8 +75,13 @@ function OAuthLoginForm({
|
|||||||
const onPressNext = async () => {
|
const onPressNext = async () => {
|
||||||
setIsProcessing(true)
|
setIsProcessing(true)
|
||||||
if (isWeb) {
|
if (isWeb) {
|
||||||
const client = getWebOAuthClient()
|
try {
|
||||||
await client.signIn(identifierValueRef.current)
|
const client = getWebOAuthClient()
|
||||||
|
await client.signIn(identifierValueRef.current)
|
||||||
|
} catch (e: any) {
|
||||||
|
logger.error(e)
|
||||||
|
setError(_(msg`An error occurred during authentication.`))
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
const client = getNativeOAuthClient()
|
const client = getNativeOAuthClient()
|
||||||
const res = await client.signIn(identifierValueRef.current)
|
const res = await client.signIn(identifierValueRef.current)
|
||||||
|
|||||||
Reference in New Issue
Block a user