mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 08:13:56 +10:00
chore: refactor code
This commit is contained in:
@ -6,11 +6,10 @@ export const testCredentialsHandler = async (req: NextApiRequest, res: NextApiRe
|
||||
try {
|
||||
const { authorization } = req.headers;
|
||||
|
||||
const user = await validateApiToken({ authorization });
|
||||
const result = await validateApiToken({ authorization });
|
||||
|
||||
return res.status(200).json({
|
||||
username: user.name,
|
||||
email: user.email,
|
||||
name: result.userId ? result.user.name : result.team?.name,
|
||||
});
|
||||
} catch (err) {
|
||||
return res.status(500).json({
|
||||
|
||||
Reference in New Issue
Block a user