mirror of
https://github.com/arun11299/cpp-jwt.git
synced 2025-05-14 16:58:34 +00:00
Change signature for has_claim_with_value API
This commit is contained in:
parent
c62a9498d9
commit
d7e4add937
4 changed files with 47 additions and 4 deletions
|
@ -421,12 +421,20 @@ public: // Exposed APIs
|
|||
/**
|
||||
*/
|
||||
template <typename T>
|
||||
bool has_claim_with_value(const std::string& cname, T&& cvalue) const
|
||||
bool has_claim_with_value(const string_view cname, T&& cvalue) const
|
||||
{
|
||||
auto itr = claim_names_.find(cname);
|
||||
if (itr == claim_names_.end()) return false;
|
||||
|
||||
return (cvalue == payload_[cname]);
|
||||
return (cvalue == payload_[cname.data()]);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
template <typename T>
|
||||
bool has_claim_with_value(registered_claims cname, T&& value) const
|
||||
{
|
||||
return has_claim_with_value(reg_claims_to_str(cname), std::forward<T>(value));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue