separate common val&fn from main to config
redirect when access login page while logined