fix: use sx for justifyContent in OAuthButtons, fix import order in test
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { describe, it, expect } from 'vitest'
|
|
||||||
import { render, screen } from '@testing-library/react'
|
import { render, screen } from '@testing-library/react'
|
||||||
|
import { describe, it, expect } from 'vitest'
|
||||||
import { OAuthButtons } from '../ui/OAuthButtons'
|
import { OAuthButtons } from '../ui/OAuthButtons'
|
||||||
|
|
||||||
describe('OAuthButtons', () => {
|
describe('OAuthButtons', () => {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { getOAuthUrl, oauthProviders } from '../lib/oauth-providers'
|
|||||||
|
|
||||||
export function OAuthButtons() {
|
export function OAuthButtons() {
|
||||||
return (
|
return (
|
||||||
<Stack direction="row" spacing={1} justifyContent="center">
|
<Stack direction="row" spacing={1} sx={{ justifyContent: 'center' }}>
|
||||||
{oauthProviders.map((p) => (
|
{oauthProviders.map((p) => (
|
||||||
<Button
|
<Button
|
||||||
key={p.id}
|
key={p.id}
|
||||||
|
|||||||
Binary file not shown.
@@ -122,7 +122,8 @@ export async function registerAuthRoutes(fastify) {
|
|||||||
const phoneRaw = request.body?.phone
|
const phoneRaw = request.body?.phone
|
||||||
const phone = phoneRaw === null || phoneRaw === undefined ? null : String(phoneRaw).trim()
|
const phone = phoneRaw === null || phoneRaw === undefined ? null : String(phoneRaw).trim()
|
||||||
|
|
||||||
if (displayName !== null && displayName.length > 40) return reply.code(400).send({ error: 'Имя/ник максимум 40 символов' })
|
if (displayName !== null && displayName.length > 40)
|
||||||
|
return reply.code(400).send({ error: 'Имя/ник максимум 40 символов' })
|
||||||
if (phone !== null) {
|
if (phone !== null) {
|
||||||
const compact = phone.replace(/[\s()-]/g, '')
|
const compact = phone.replace(/[\s()-]/g, '')
|
||||||
if (compact.length > 20) return reply.code(400).send({ error: 'Телефон слишком длинный' })
|
if (compact.length > 20) return reply.code(400).send({ error: 'Телефон слишком длинный' })
|
||||||
|
|||||||
Reference in New Issue
Block a user