Coder Social home page Coder Social logo

(node:100152) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'state' of undefined on the /redirect about microsoft-identity-express HOT 6 CLOSED

azure-samples avatar azure-samples commented on July 21, 2024
(node:100152) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'state' of undefined on the /redirect

from microsoft-identity-express.

Comments (6)

PramodKumarHK89 avatar PramodKumarHK89 commented on July 21, 2024 1

Thanks @derisen. It is working now.

from microsoft-identity-express.

VVAAAA avatar VVAAAA commented on July 21, 2024 1

Thanks @derisen its now working for me also.

from microsoft-identity-express.

derisen avatar derisen commented on July 21, 2024

@VVAAAA apologies for late response. Can you confirm you've configured the express session middleware? Also, it would be a good idea to add the session middleware right after creating the app object and before setting up public assets like template files. For instance:

const app = express();

app.use(session({
    secret: 'ENTER_YOUR_SECRET_HERE',
    resave: false,
    saveUninitialized: false,
    cookie: {
        secure: false,
    }
}));

app.set('views', path.join(__dirname, './views'));
app.set('view engine', 'ejs');

Can you give this a try and let me know if it helps?

from microsoft-identity-express.

pramodkumarhk avatar pramodkumarhk commented on July 21, 2024

@derisen : I'm also running into same issue. I have made the changes as per your suggestion, and yet I get the same error.I just downloaded the sign-in sample and has not done any code changes apart from your suggestion of moving the middleware up.

from microsoft-identity-express.

derisen avatar derisen commented on July 21, 2024

@pramodkumarhk I've just updated the samples in the repo which should resolve this issue. Would you mind giving it a try again?

from microsoft-identity-express.

derisen avatar derisen commented on July 21, 2024

Sounds great! Closing this.

from microsoft-identity-express.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.