clears token that was generated during user registration process as updating your current user signifies that your registration is complete and token is no longer needed
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/f0b9c158 Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/f0b9c158 Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/f0b9c158 Branch: refs/heads/master Commit: f0b9c1584b1c16f80bd22556d2ee9bd4307f3c6e Parents: 331f134 Author: Jeremy Mitchell <[email protected]> Authored: Wed Jul 12 12:53:01 2017 -0600 Committer: Dewayne Richardson <[email protected]> Committed: Wed Jul 12 13:05:35 2017 -0600 ---------------------------------------------------------------------- traffic_ops/app/lib/API/User.pm | 2 ++ 1 file changed, 2 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/f0b9c158/traffic_ops/app/lib/API/User.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/User.pm b/traffic_ops/app/lib/API/User.pm index 117030d..c83d9ef 100644 --- a/traffic_ops/app/lib/API/User.pm +++ b/traffic_ops/app/lib/API/User.pm @@ -564,6 +564,8 @@ sub update_current { if ( defined( $user->{"country"} ) ) { $db_user->{"country"} = $user->{"country"}; } + # token is intended for new user registrations and on current user update, it should be cleared from the db + $db_user->{"token"} = undef; $dbh->update($db_user); return $self->success_message("UserProfile was successfully updated."); }
