Skip to content

Commit

Permalink
Addendum to last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
StiviiK committed Jul 27, 2019
1 parent a3a0c22 commit d8a98b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion module/CFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ int CFunctions::sign_jwt_token(lua_State* lua_vm)
const auto func_ref = luaL_ref(lua_vm, LUA_REGISTRYINDEX);

// Read other arguments
const auto claims = Utils::parse_named_table(lua_vm, 2);
const auto claims = Utils::parse_table(lua_vm, 2);
const auto algorithm = jwt_algorithm(reinterpret_cast<size_t>(lua_touserdata(lua_vm, 3)));
const auto private_key_path = lua_tostring(lua_vm, 4);
std::string private_key = private_key_path;
Expand Down
4 changes: 2 additions & 2 deletions module/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static const int index_key = -2;

enum jwt_algorithm : size_t
{
jwt_algorithm_none = 0x12345678ABCDEF,
jwt_algorithm_none = 0x123456789ABCDEF,
jwt_algorithm_hs256 = jwt_algorithm_none << 1,
jwt_algorithm_hs384 = jwt_algorithm_none << 2,
jwt_algorithm_hs512 = jwt_algorithm_none << 3,
Expand All @@ -28,7 +28,7 @@ enum jwt_algorithm : size_t
class Utils
{
public:
static inline std::unordered_map<std::string, std::string> parse_named_table(lua_State* lua_vm, const int index)
static inline std::unordered_map<std::string, std::string> parse_table(lua_State* lua_vm, const int index)
{
unordered_map<std::string, std::string> result;

Expand Down

0 comments on commit d8a98b5

Please sign in to comment.