Add token validation in user registration.

Issue #185