support loggin states in template. redirect to profile after login.