Check authorization only if user is logged

Currently it was checking if user is authorized or not always, even when the user is not logged yet...

This condition checks if user is logged if not it does not check the authorization