Fixing potential authentication and login deadlocks with await / async