frontend authentication, events javascript in seperate file