Loading data/modules/iap_verifier.lua +4 −4 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ function M.verify_payment_apple(request) end function M.google_obtain_access_token(client_email, private_key) local auth_url = "https://accounts.google.com/o/oauth2/auth" local auth_url = "https://accounts.google.com/o/oauth2/token" local scope = "https://www.googleapis.com/auth/androidpublisher" local exp = nk.time() + 3600000 -- current time + 1hr added in ms local iat = nk.time() Loading @@ -95,7 +95,7 @@ function M.google_obtain_access_token(client_email, private_key) local jwt_token = nk.jwt_generate(algo_type, private_key, jwt_claimset) local grant_type = "urn%3ietf%3params%3oauth%3grant-type%3jwt-bearer" local grant_type = "urn:ietf:params:oauth:grant-type:jwt-bearer" local form_data = "grant_type=" .. grant_type .. "&assertion=" .. jwt_token local http_headers = { ["Content-Type"] = "application/x-www-form-urlencoded", Loading server/runtime_lua_nakama.go +6 −1 Original line number Diff line number Diff line Loading @@ -741,7 +741,12 @@ func (n *RuntimeLuaNakamaModule) jwtGenerate(l *lua.LState) int { } token := jwt.NewWithClaims(signingMethod, jwtClaims) signedToken, _ := token.SignedString([]byte(signingKey)) signedToken, err := token.SignedString([]byte(signingKey)) if err != nil { l.RaiseError("failed to sign token: %v", err.Error()) return 0 } l.Push(lua.LString(signedToken)) return 1 } Loading Loading
data/modules/iap_verifier.lua +4 −4 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ function M.verify_payment_apple(request) end function M.google_obtain_access_token(client_email, private_key) local auth_url = "https://accounts.google.com/o/oauth2/auth" local auth_url = "https://accounts.google.com/o/oauth2/token" local scope = "https://www.googleapis.com/auth/androidpublisher" local exp = nk.time() + 3600000 -- current time + 1hr added in ms local iat = nk.time() Loading @@ -95,7 +95,7 @@ function M.google_obtain_access_token(client_email, private_key) local jwt_token = nk.jwt_generate(algo_type, private_key, jwt_claimset) local grant_type = "urn%3ietf%3params%3oauth%3grant-type%3jwt-bearer" local grant_type = "urn:ietf:params:oauth:grant-type:jwt-bearer" local form_data = "grant_type=" .. grant_type .. "&assertion=" .. jwt_token local http_headers = { ["Content-Type"] = "application/x-www-form-urlencoded", Loading
server/runtime_lua_nakama.go +6 −1 Original line number Diff line number Diff line Loading @@ -741,7 +741,12 @@ func (n *RuntimeLuaNakamaModule) jwtGenerate(l *lua.LState) int { } token := jwt.NewWithClaims(signingMethod, jwtClaims) signedToken, _ := token.SignedString([]byte(signingKey)) signedToken, err := token.SignedString([]byte(signingKey)) if err != nil { l.RaiseError("failed to sign token: %v", err.Error()) return 0 } l.Push(lua.LString(signedToken)) return 1 } Loading