Move login JS to distinct file and convert to Angular module.