javascript - Passport.js - use same token for different server -
i'm using passport.js , mongodb user login , postapi authentications. whenever deploy node server aws instance, need go through signup process, login , new token.
i know can see saved users , jwt tokens mongodb. there anyway can copy token and, when initialize new database, save same username-jwttoken pair default, can use same token string (not password, though more done) pass passport authentication test?
thanks!
it sounds deployment process involves tearing (application , mongodb) down & rebuilding zero, possibly seed data without of "live" data in aws instance. here couple of ideas:
copy data old mongodb instance new 1 part of deployment process. ensure users present on new instance , (should) ensure users don't have go through signup process again. i'm not familiar mongodb don't know how this, i'm sure there's way - maybe can copy data files 1 other?
set environment 2 servers: mongodb server , application server. way can tear down application , create new aws instance application without touching mongodb server. update mongodb connection configuration in new application instance point same mongodb server you've been using.
the first option more suitable if have small application without data. if database gets large, you're going experience long periods of downtime during deployment take application down, copy data out of old mongo instance, copy data new mongo instance, , bring application up.
the second option better one, although require knowledge of networking , securing mongodb application has access data.
Comments
Post a Comment