mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
Remove more deprecated user routes
This commit is contained in:
@@ -4,7 +4,6 @@ import * as jwt from 'jsonwebtoken'
|
||||
import { SECRET, LOGIN_VALID_MS, USER_CREATION_SECRET } from '../utils/config'
|
||||
import * as bcrypt from 'bcrypt'
|
||||
import { nowDb } from '../utils/db'
|
||||
import { getAllUsers, getUserDetails } from '../services/user'
|
||||
import { getRole } from '../middlewares/authenticator'
|
||||
|
||||
const router = Router()
|
||||
@@ -38,17 +37,6 @@ router.post('/login', async (req, res) => {
|
||||
})
|
||||
})
|
||||
|
||||
router.get('/all', async (_req, res) => {
|
||||
const users = await getAllUsers()
|
||||
return res.status(200).send(users)
|
||||
})
|
||||
|
||||
router.get('/:id', async (req, res) => {
|
||||
const id = parseInt(req.params.id)
|
||||
const user = await getUserDetails(id)
|
||||
res.status(200).send(user)
|
||||
})
|
||||
|
||||
router.post('/create', async (req, res) => {
|
||||
// TODO type guards
|
||||
const { username, password, secret } = req.body
|
||||
|
||||
@@ -4,7 +4,6 @@ import { useDispatch } from 'react-redux'
|
||||
import { Box, Button, CircularProgress, Container, Stack, TextField, Typography } from '@mui/material'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { api } from '../redux/api'
|
||||
import { Role } from '@/types'
|
||||
|
||||
export const Login = () => {
|
||||
const [username, setUsername] = useState('')
|
||||
|
||||
Reference in New Issue
Block a user