Made login warning run only once.

@sharadmv can you take a look at this?

Is there any way to make this more "angular", or is this ok.