here is my problem, when I post from using the classic form post the post goes to server if certain conditions are met the server then redirect to the specific page but when I use fetch request for posting due to the need to model data a certain way a yet with similar request the server doesn't redirect me to the wanted page and it just stays where it is , any solution my bet is I need to add something to my fetch so the fetch will respond to the redirection sent by the server.
// Front-End Code Fetch
fetch('/pin', {
credentials: "same-origin",
mode: "same-origin",
method: 'post',
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(inputJSON)
})
// Back-End Code
exports.pin = async (req, res, next) => {
res.redirect(`/app`)
}
// Routing model
app.route('/pin')
.post(authentication.pin)
app.route('/app')
.get(toAppControler.getApp)