Added Utility and Type namespaces

This commit is contained in:
kdeng00
2019-09-01 16:56:52 -04:00
parent 1ec3511bc5
commit dfd4906371
30 changed files with 233 additions and 59 deletions
+3 -3
View File
@@ -86,7 +86,7 @@ Model::loginResult Manager::token_manager::retrieve_token(const Model::BinaryPat
return lr;
}
bool Manager::token_manager::is_token_valid(std::string& auth, Scope scope)
bool Manager::token_manager::is_token_valid(std::string& auth, Type::Scope scope)
{
auto authPair = fetch_auth_header(auth);
@@ -103,10 +103,10 @@ bool Manager::token_manager::is_token_valid(std::string& auth, Scope scope)
auto scopes = extract_scopes(jwt::decode(token));
switch (scope) {
case Scope::upload:
case Type::Scope::upload:
return token_supports_scope(scopes, "upload:songs");
break;
case Scope::download:
case Type::Scope::download:
return token_supports_scope(scopes, "download:songs");
default:
break;