how i sending an auth error from node js to my html client page?

49
April 23, 2019, at 00:30 AM

Im new to node js and now im rewriting my website , I scripting the log in page , my issue is to send back to the client page the error message

I tried flash , but not really understand how to use it in the html page...

    connection.query('SELECT * FROM user WHERE u_login = "'+username+'" AND u_password = "'+password    +'"',  function(error, results, fields) {
            if (results.length > 0) {
                request.session.loggedin = true;
                request.session.username = username;
                response.redirect('/home');
            } else {
                response.flash('mes','error');
                response.redirect('/log_in');
            }           

and no idea how to continue in the html page

READ ALSO
Reload perticular textbox/select option using javaScript

Reload perticular textbox/select option using javaScript

I want to refresh/reload a particular textbox/ Select option using javaScriptJust like when the page loads for the first time

44
How to avoid triggering of repeated pubnub notification via JS on webpage return

How to avoid triggering of repeated pubnub notification via JS on webpage return

I have a problem with JS bootstrap notify event on using with pubnub

46
foreach loop array promise not being returned

foreach loop array promise not being returned

I want to access a subcollection called 'followers' from a given id under the 'mobile_user', this contains the id's of the followersI want to loop through each of the id's in the followers subcollection and query data from the 'mobile_user' collection

19
Why do I see TypeScript in Vue.js source code?

Why do I see TypeScript in Vue.js source code?

I went through the vuejs source code just to have a look, and I saw some strange code, which I learnt was TypeScript syntax after some research

33