Fix project scoped token

domain_id is used to match if user has right to access most resources
in v3 api but the previous code was only checking if token was scoped
in a domain, we add here checks for checking the project domain in
case token was project scoped and user domain in case of no scoped
token