Authentication now works correctly