liamcurry/passport-steam

How to manage dynamic strategy return URL?

kamilml opened this issue · 2 comments

How can I put multiple returnURL based on a cookie of my users?

@kamilml i just found an ideal solution

const _ = require('lodash');

passport.use(new SteamStrategy({
    get returnURL() {
    return _.sample(['domain', 'another'])
  },
    get apiKey() {
      return _.sample(['key', 'another'])
    },
  },
  (identifier, profile, next) => {
    next(null, profile)
  }))

@dilame Your solution looks good to me, will close this as resolved.

@kamilml if you're looking for something different, please contest the above solution, or open a new ticket.