Authentication tidying up

Signed-off-by: nox <dimasavitski@gmail.com>