mirror of
https://github.com/arun11299/cpp-jwt.git
synced 2025-05-15 01:08:31 +00:00
Fix string view overload for claim value
This commit is contained in:
parent
98ea0d6e58
commit
f8eebbede0
3 changed files with 35 additions and 1 deletions
|
@ -300,7 +300,9 @@ public: // Exposed APIs
|
|||
*/
|
||||
template <typename T,
|
||||
typename=typename std::enable_if_t<
|
||||
!std::is_same<system_time_t, std::decay_t<T>>::value>
|
||||
!std::is_same<system_time_t, std::decay_t<T>>::value ||
|
||||
!std::is_same<jwt::string_view, std::decay_t<T>>::value
|
||||
>
|
||||
>
|
||||
bool add_claim(const string_view cname, T&& cvalue, bool overwrite=false)
|
||||
{
|
||||
|
@ -320,6 +322,13 @@ public: // Exposed APIs
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
bool add_claim(const string_view cname, const string_view cvalue, bool overwrite=false)
|
||||
{
|
||||
return add_claim(cname, std::string{cvalue.data(), cvalue.length()}, overwrite);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
bool add_claim(const string_view cname, system_time_t tp, bool overwrite=false)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue