@ -1,7 +1,7 @@
|
||||
{
|
||||
"workbench.colorCustomizations": {
|
||||
"activityBar.background": "#4C1F25",
|
||||
"titleBar.activeBackground": "#6A2C34",
|
||||
"titleBar.activeForeground": "#FEFCFC"
|
||||
"activityBar.background": "#521342",
|
||||
"titleBar.activeBackground": "#731B5D",
|
||||
"titleBar.activeForeground": "#FDF8FC"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
|
||||
import { NextApiRequest, NextApiResponse } from 'next';
|
||||
import { getSession } from 'next-auth/react';
|
||||
import { Role } from '../../../enum/role.enum';
|
||||
import prisma from '../../../lib/prisma';
|
||||
|
||||
|
||||
//api qui va rendre un utilisateur super admin (pour les developpeurs)
|
||||
//--> http://localhost:3000/api/superadmin?pass=1234 (a effacer)
|
||||
|
||||
export default async function makeMeSuper(req: NextApiRequest, res: NextApiResponse) {
|
||||
const { pass } = req.query;
|
||||
const session = await getSession({ req })
|
||||
const goodPassword = pass === '1234';
|
||||
|
||||
//si utilisateur connecté et que le parametre 'pass' est '1234'
|
||||
if (session && goodPassword) {
|
||||
|
||||
//MAJ de l'utilisateur en superadmin
|
||||
await prisma.user.update({
|
||||
where: { email: session.user.email },
|
||||
data: {
|
||||
role: Role.SUPERADMIN,
|
||||
},
|
||||
})
|
||||
return res.status(200).send({ message: 'Profiled updated welcome SUPERADMIN !' });
|
||||
} else {
|
||||
res.status(401).send({ message: 'Unauthorized' })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 760 KiB |
|
After Width: | Height: | Size: 358 KiB |
|
After Width: | Height: | Size: 11 MiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 61 KiB |
|
After Width: | Height: | Size: 497 KiB |
|
After Width: | Height: | Size: 5.9 MiB |
|
After Width: | Height: | Size: 5.7 MiB |
|
After Width: | Height: | Size: 787 KiB |
|
After Width: | Height: | Size: 17 MiB |
|
After Width: | Height: | Size: 12 MiB |
|
After Width: | Height: | Size: 15 MiB |
|
After Width: | Height: | Size: 3.5 MiB |
|
After Width: | Height: | Size: 9.1 MiB |