Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transport: querystring redirecting to / #311

Open
victormier opened this issue Oct 1, 2024 · 1 comment
Open

Transport: querystring redirecting to / #311

victormier opened this issue Oct 1, 2024 · 1 comment

Comments

@victormier
Copy link

Hi!

I tried the express transport-querystring example with the following configuration:

{
  "defaults": {
    "origin": "http://localhost:3000",
    "transport": "querystring"
  },
  "zoom": {
    "key": "...",
    "secret": "...",
  }
}

and the correct express handler

var express = require('express')
var session = require('express-session')
var grant = require('../../').express()

express()
  .use(session({secret: 'grant', saveUninitialized: true, resave: false}))
  .use(grant(require('./config.json')))
  .get('/connect/zoom/callback', (req, res) => {
    res.end(JSON.stringify(req.query, null, 2))
  })
  .listen(3000)

And the callback route http://localhost:3000/connect/zoom/callback redirects to http://localhost:3000/.

Everything works well if I change to session transport, and I think it might be related to how the session is handled, maybe the express-session package?, but I can't find it.

Is there a bug here or am I configuring something wrong?

Thanks!

@simov
Copy link
Owner

simov commented Oct 1, 2024

There is something missing in your config.json it should contain the callback key there as in the example. Basically you need to only:

  1. npm install
  2. Set your key and secret in config.json

If that didn't work I will be really surprised, but let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants