src: Login js fixes
src: Login js fixes

Suggested by coverity

Closes #5310
Reviewed-by: Stef Walter <8a7fbf0f15d3ad982af54ef28f5c117d2494b76c@redhat.com>

garrett/cockpit,dperpeet/cockpit,dperpeet/cockpit,deryni/cockpit,moraleslazaro/cockpit,cockpit-project/cockpit,SotolitoLabs/cockpit,harishanand95/cockpit,moraleslazaro/cockpit,dperpeet/cockpit,Scribery/cockpit,arilivigni/cockpit,petervo/cockpit,andreasn/cockpit,xhad/cockpit,xhad/cockpit,andreasn/cockpit,Scribery/cockpit,larsu/cockpit,garrett/cockpit,larsu/cockpit,martinpitt/cockpit,SotolitoLabs/cockpit,mareklibra/cockpit,cockpit-project/cockpit,andreasn/cockpit,larskarlitski/cockpit,sgallagher/cockpit,garrett/cockpit,larsu/cockpit,mareklibra/cockpit,martinpitt/cockpit,sgallagher/cockpit,vanloswang/cockpit,petervo/cockpit,mareklibra/cockpit,mvollmer/cockpit,Scribery/cockpit,andreasn/cockpit,SotolitoLabs/cockpit,garrett/cockpit,michalskrivanek/cockpit,SotolitoLabs/cockpit,deryni/cockpit,arilivigni/cockpit,harishanand95/cockpit,Scribery/cockpit,larskarlitski/cockpit,vanloswang/cockpit,larsu/cockpit,petervo/cockpit,mareklibra/cockpit,petervo/cockpit,stefwalter/cockpit,sgallagher/cockpit,harishanand95/cockpit,mareklibra/cockpit,larskarlitski/cockpit,michalskrivanek/cockpit,Scribery/cockpit,moraleslazaro/cockpit,arilivigni/cockpit,sgallagher/cockpit,SotolitoLabs/cockpit,harishanand95/cockpit,mvollmer/cockpit,moraleslazaro/cockpit,cockpituous/cockpit,dperpeet/cockpit,moraleslazaro/cockpit,cockpituous/cockpit,mvollmer/cockpit,sgallagher/cockpit,moraleslazaro/cockpit,mareklibra/cockpit,cockpituous/cockpit,arilivigni/cockpit,deryni/cockpit,michalskrivanek/cockpit,stefwalter/cockpit,xhad/cockpit,dperpeet/cockpit,andreasn/cockpit,andreasn/cockpit,mvollmer/cockpit,xhad/cockpit,stefwalter/cockpit,xhad/cockpit,xhad/cockpit,mvollmer/cockpit,stefwalter/cockpit,stefwalter/cockpit,larsu/cockpit,cockpituous/cockpit,michalskrivanek/cockpit,SotolitoLabs/cockpit,vanloswang/cockpit,mareklibra/cockpit,cockpit-project/cockpit,vanloswang/cockpit,michalskrivanek/cockpit,martinpitt/cockpit,petervo/cockpit,xhad/cockpit,stefwalter/cockpit,deryni/cockpit,dperpeet/cockpit,dperpeet/cockpit,michalskrivanek/cockpit,deryni/cockpit,deryni/cockpit,cockpit-project/cockpit,arilivigni/cockpit,sgallagher/cockpit,larskarlitski/cockpit,harishanand95/cockpit,larsu/cockpit,vanloswang/cockpit,harishanand95/cockpit,arilivigni/cockpit,vanloswang/cockpit,stefwalter/cockpit,moraleslazaro/cockpit,martinpitt/cockpit,petervo/cockpit,larskarlitski/cockpit,vanloswang/cockpit,larskarlitski/cockpit,petervo/cockpit,cockpit-project/cockpit,garrett/cockpit,deryni/cockpit,michalskrivanek/cockpit,cockpituous/cockpit,cockpituous/cockpit,martinpitt/cockpit,andreasn/cockpit,sgallagher/cockpit,Scribery/cockpit,Scribery/cockpit,arilivigni/cockpit,harishanand95/cockpit,SotolitoLabs/cockpit,larskarlitski/cockpit