feat: allow unauthenticated users to perform domain name lookups

This commit is contained in:
Maël Gangloff
2025-12-08 18:18:33 +01:00
parent eddb267275
commit 5476ee7acc
16 changed files with 214 additions and 110 deletions

View File

@@ -2,10 +2,10 @@ import {Button, Flex, Form, Input, message} from 'antd'
import {t} from 'ttag'
import React, {useContext, useEffect, useState} from 'react'
import {getUser, login} from '../utils/api'
import {AuthenticatedContext} from '../pages/LoginPage'
import {useNavigate} from 'react-router-dom'
import {showErrorAPI} from '../utils/functions/showErrorAPI'
import {AuthenticatedContext} from "../contexts"
interface FieldType {
username: string
@@ -66,9 +66,9 @@ export function LoginForm({ssoLogin}: { ssoLogin?: boolean }) {
</Form.Item>
<Flex wrap justify="center" gap="middle">
<Button type='primary' htmlType='submit'>
{t`Submit`}
</Button>
<Button type='primary' htmlType='submit'>
{t`Submit`}
</Button>
{ssoLogin &&
<Button type='dashed' htmlType='button' href='/login/oauth'>
{t`Log in with SSO`}

View File

@@ -17,10 +17,14 @@ import {
UserOutlined
} from '@ant-design/icons'
import {Menu} from 'antd'
import React from 'react'
import React, {useContext} from 'react'
import {useLocation, useNavigate} from 'react-router-dom'
import {AuthenticatedContext, ConfigurationContext} from "../contexts"
export function Sider() {
const {isAuthenticated} = useContext(AuthenticatedContext)
const {configuration} = useContext(ConfigurationContext)
export function Sider({isAuthenticated}: { isAuthenticated: boolean }) {
const navigate = useNavigate()
const location = useLocation()
@@ -42,7 +46,7 @@ export function Sider({isAuthenticated}: { isAuthenticated: boolean }) {
icon: <CompassOutlined/>,
label: t`Domain`,
title: t`Domain Finder`,
disabled: !isAuthenticated,
disabled: !configuration?.publicRdapLookupEnabled && !isAuthenticated,
onClick: () => navigate('/search/domain')
},
/*