separate username reading and logging in

Signed-off-by: Mattias Andrée <maandree@operamail.com>