mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: allow unauthenticated users to perform domain name lookups
This commit is contained in:
@@ -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`}
|
||||
|
||||
@@ -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')
|
||||
},
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user