#account systeme
6 messages · Page 1 of 1 (latest)
🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord
🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize
✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)
what is the best method and how to do it securely?
I haven't used api for a long time and I don't understand it all.
The test api you have created, what does it look like?
I create one using the slug api named [id].js and i want to know if that better to use the api req.body (when i try use req.body thats dont work) and my slug api test is :
import { NextApiRequest, NextApiResponse } from 'next'
import User from '../../../module/sequelize/model/User'
import { Sequelize } from 'sequelize'
export default async function handler(_req, res) {
const { id } = _req.query
try {
await User.findOne({
where: {
[Sequelize.Op.or]: [{ id: `${id}` }],
},
}).then(x=>{
if(x&&x.username){
res.end(`${x.username}`)
}else{
res.end(`can't find`)
}
})
} catch (error) {
// Handle any errors that occur during the request
res.end(`err : ${error}`)
}
}
@ionic patio