Slotos/passport-reddit

Duration in Strategy configuration

Closed this issue · 3 comments

Instead of including the state and duration options on the route handler, can it not be included in the strategy's options? I know it works when setting the state, but it does not for duration.

For example:

passport.use(new RedditStrategy({
    clientID: REDDIT_CONSUMER_KEY,
    clientSecret: REDDIT_CONSUMER_SECRET,
    callbackURL: "http://127.0.0.1:3000/auth/reddit/callback",
    state: "exampleState",        // works
    duration: "permanent"         // does not work
  },
  function(...

Confirmed this issue. I tried a few different variations:

  • duration in RedditStrategy instantiation.
  • duration and state in RedditStrategy instantiation.
  • duration in authenticate call.
  • duration and state in authenticate call.
  • duration and state in RedditStrategy instantiation and in authenticated call.

Nothing gets duration into the list of query parameters.

duration parameter goes to authenticate call.

Example app is updated and I had tested that duration is passed along. You can use it yourself, I'd made it take secrets from runtime environment. If that doesn't help, share the code you're having trouble with.

Closing this issue as non-reproducible. Will reopen once a reproduction case is presented.