first of all, thank you all for the amazing work of $$F7.
I’m facing a problem on the login screen I don’t know if I’m doing it correctly, I’ve tried several ways and I still face one problem or another.
my problem here is whenever I reload the page it displays the login screen and then goes back to the current screen.
Senary:
index.html → auth login screen
pages/dashboard.html - home screen
Whenever I reload a screen it displays the login screen along with the authentication.
Router file:
var routes = [
{
name: "login",
path: '/',
// url: './index.html',
async: async function ({ app, to, form, resolve, reject }) {
let router = this
const login = await MODEL.checkSession()
if (login.data.auth) {
$('#load').css({ "display": "none" })
resolve({ url: './pages/dasboard.html' })
} else {
$('#load').css({ "display": "none" })
resolve({ url: './index.html' })
reject();
}
},
{
name: 'dashboard',
path: '/dashboard/',
// url: './pages/dashboard.html',
async: async function ({ app, to, form, resolve, reject }) {
let router = this
const login = await MODEL.checkSession()
if (login.data.auth) {
resolve({ url: './pages/dashboard.html' })
} else {
// resolve({url: './index.html'})
$('#load').css({ "display": "none" })
reject();
router.navigate('/');
}
},
my doubt is how can I work with the login correctly so that it doesn’t reload the login page before, thank you all.
debug movie: test.mov - Google Drive