refactoring register to use form post instead of socket (for passport integration)