Questions tagged [connect-flash]

Express middleware for storing messages in the session. Connect-flash was part of Express until Express 3. connect-flash

107 questions
1
vote
2 answers

Nodejs Flash messages only loads after the page is refreshed (connect-flash)

I'm getting stuck with connect-flash , all flash messages doesn't load on the page unless I refresh for a couple of times I'm not sure why. I created a small project just to test connect-flash and it's the same result, please check the code…
1
vote
0 answers

Express NodeJS | Express-messages, Express-validator, and Connect-Flash not displaying messages

this question is kind of all over the place but basically, it should be displaying messages whenever you login/logout and if you haven't filled in the correct input. None of the messages come up and I'm not getting any errors but everything else…
Buckets
  • 89
  • 1
  • 8
1
vote
1 answer

Getting connect-flash package to render flash message

I am learning expressjs and mongodb by going through exercises. I want to render flash messages when a new items is added, updated or deleted. It isn't working though I also don't get any errors either, so it's difficult to pinpoint the exact…
OLA
  • 861
  • 2
  • 11
  • 23
1
vote
1 answer

Displaying connect-flash message from Facebook Strategy when email exists

I am trying to display an error message when I test to see if the email address associated to the passport facebook strategy already exists in the database. Here is my code: // callback route for facebook to redirect…
1
vote
2 answers

Connect-flash message is not working for res.render("SomeView")

I am not able to use connect-flash package for res.render. My main aim is to display a flash message on rendering of a view. I am able to make it work with a res.redirect("route") but not with the res.render("view") code. Is it by design ? My code…
harry
  • 11
  • 6
1
vote
1 answer

How to get flash messages working with handlebars?

I am trying to get flash working with my handlebars templates, but it doesn't work. How can I display messages if (!user) return done(null, false, { message: 'No user found'}) and return done(null, false, { message: 'Oops! Wrong password.'}) in…
Engo
  • 899
  • 3
  • 19
  • 49
1
vote
2 answers

Flash Message from ejs in Express 4

I am trying to show a confirmation message before user deletes anything. I've tried following various related sources that I found in internet, but couldn't get them to work. I am using EJS template and Express 4. app.js var express =…
Jane
  • 283
  • 3
  • 5
  • 16
1
vote
1 answer

Trouble understanding how exactly to use connect-flash with Express 4.x?

So the basics of this is, I have a login form - if the user enters in the wrong account info, I want it to redirect back to the login page and display a message stating that they entered in the wrong information - right now I'm simply trying to…
secondubly
  • 983
  • 5
  • 18
  • 43
1
vote
2 answers

Why is 'message' undefined regarding connect-flash?

I'm building an express app where when a user completes a form; if successful, they will see an alert confirming their submission. In my server.js file, I am declaring var cookieParser = require("cookie-parser"), session =…
sseeaann
  • 15
  • 1
  • 3
1
vote
2 answers

Redirect with connect-flash message when trying to access route when not logged in

I would like to redirect to the login page with an error message, when someone tried to access my admin page without authenticating, ie when someone tries to bypass the login page. this is my admin end point: server.get('/admin', isLoggedIn,…
Bondifrench
  • 1,272
  • 1
  • 20
  • 35
1
vote
1 answer

Connect flash where is the session object from

I am using in my express app the message alert middleware connect-flash. I can find this middleware on github https://github.com/jaredhanson/connect-flash. When i look at connect-flash source code, i really don't know, where the this.session object…
softshipper
  • 32,463
  • 51
  • 192
  • 400
0
votes
0 answers

display flash message using connect-flash & bootstrap 4 alert

i want to make flash message with bootstrap alert using connect-flash, i believe i did everything right if i follow from all answers i've got from googling, but still not working. i already put require('connect-flash'), using app.use(flash());, make…
fey_23
  • 11
  • 1
0
votes
0 answers

How to use connect-flash with passport-local

hello every one i was trying to use connect-flash with passport local but can not seem to find relevant info either on the docs and other sources,if any one can guide me on this and tell me what i went wrong ,thanks.And why does request to…
ayex
  • 65
  • 7
0
votes
1 answer

How to proper use express flash message on req.redirect

I am following a tutorial of how to creat a blogapp using expressjs, mongoDB and handlebars. The instructor uses req.flash() in a req.redirect command and it works for him, but when I try it, my page does not display the message. The problem is that…
0
votes
0 answers

using request.flash show login error message

The ideal condition is while in route '/login/users', showing 'Please login first'. And after typing, if eamil or password is not suitable, showing 'This email is not registered!' or 'Email or Password is incorrect. But, Not knowing how to make it…
leo47
  • 1