$http Post & Passport.js Redirect May 18, 2024 Post a Comment I have a multi-step Angular.js form for signup that saves all the users input into: $scope.user = {}; Then I use ng-submit like so: Solution 1: Not shure, but it might help.In Angular: $scope.signup = function(){ return$http.post('/signup',$scope.user) .then(function(data) { location.replace(data.redirectUrl); // use appropriate function to update route }); }; CopyIn nodejs:Baca JugaCan't Browserify File - "error: Parsing File" (html5 Checkvalidity() ?)Closing Mongodb Connection In Node.js While Inserting Lot Of DataCallback Confusion And Collecting Data In Node app.post('/signup', passport.authenticate('local-signup', { failWithError: true }), function(req, res, next) { // successreturn res.json({ redirectUrl: '/profile' }); }, function(err, req, res, next) { // errorreturn res.json({ redirectUrl: '/' }); } ); Copy Share You may like these postsWhen I Uncomment One Line Of Code, I Receive This Error: _http_outgoing.js:359 Throw New Error('can\'t Set Headers After They Are Sent.');Passport Middleware For Node.jsAuthenticating Node Api With Passport-jwtReferenceerror: User Is Not Defined Post a Comment for "$http Post & Passport.js Redirect"
Post a Comment for "$http Post & Passport.js Redirect"