Skip to content

Commit 7dda553

Browse files
authored
Merge pull request #45 from teacoder-team/dev
fix(auth): fallback to client request if fingerprint unavailable
2 parents 9b84356 + fcfc9b7 commit 7dda553

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

  • src/app/auth/telegram-oauth-finish

src/app/auth/telegram-oauth-finish/page.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function base64DecodeUnicode(str: string) {
2828
export default function TelegramAuthFinishPage() {
2929
const router = useRouter()
3030

31-
const { data: fingerprint } = useFingerprint()
31+
const { data: fingerprint, error } = useFingerprint()
3232

3333
const { mutate } = useTelegramAuth({
3434
onSuccess(data) {
@@ -53,12 +53,13 @@ export default function TelegramAuthFinishPage() {
5353
if (typeof user !== 'object' || user === null)
5454
throw new Error('Decoded value is not an object')
5555

56-
if (fingerprint)
57-
mutate({
58-
...user,
56+
mutate({
57+
...user,
58+
...(fingerprint && {
5959
visitorId: fingerprint.visitorId,
6060
requestId: fingerprint.requestId
6161
})
62+
})
6263
} catch (err) {
6364
console.error(
6465
'Ошибка парсинга JSON после декодирования:',

0 commit comments

Comments
 (0)