re implementing login code to ngWidApp