Added check if user identity became null then define user as unauthorized.