build authenticate method in login controller