I think it should be:

```
if request.grant_type == 'password':
    return True
return 'Authorization' in ....
```