added platform-side login code and cleaned up the controller
added redirect code for post-login