I am trying to extract a reset pw token from a link in a reset pw email. The link sends the user back to my node / angular application with the token I am trying to get.
Laravel API Template:
<td class="content"> <a href="http://localhost:3000/reset-password?token={{$token}}">Reset Your Password</a> </td>
Node / angular app: ResetPassword.ejs template: I use an angular controller:
<div ng-controller="resetPasswordCtrl"> ...stuff </div>
reset Password Controller:
'use strict'; angular .module('myApp') .controller('resetPasswordCtrl', ['$scope', '$routeParams', '$location', function($scope, $routeParams, $location) { console.log('ROUTE PARAMS', $routeParams); //object with a bunch of getters/setters console.log('ROUTE PARAMS', $routeParams.token); //undefined console.log('Location', $location.search('token')); //LocationHashbangUrl console.log('Location', $location.search().token); //true console.log('Location', $location.search()['token']); //true console.log('Route current params', $route); //empty route object }]);
For LocationHashbangUrl ( $location.search('token') ), I know that I get the correct URL with a token because it shows $$ absUrl.

Why can't I get the token parameter using one of these methods shown on the controller?
source share