spinen / laravel-clickup

SPINEN's Laravel Package for ClickUp.
27 stars 14 forks source link

Invalid payload #6

Closed FLCreative closed 4 years ago

FLCreative commented 4 years ago

Hello,

I followed exactly the example you gave but when I call clickup() on my user I get the following error :

{ "message": "The payload is invalid.", "exception": "Illuminate\\Contracts\\Encryption\\DecryptException", "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Encryption\\Encrypter.php", "line": 195, "trace": [ { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Encryption\\Encrypter.php", "line": 136, "function": "getJsonPayload", "class": "Illuminate\\Encryption\\Encrypter", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\spinen\\laravel-clickup\\src\\Concerns\\HasClickUp.php", "line": 73, "function": "decrypt", "class": "Illuminate\\Encryption\\Encrypter", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Eloquent\\Concerns\\HasAttributes.php", "line": 454, "function": "getClickupTokenAttribute", "class": "App\\Models\\User", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Eloquent\\Concerns\\HasAttributes.php", "line": 350, "function": "mutateAttribute", "class": "Illuminate\\Database\\Eloquent\\Model", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Eloquent\\Concerns\\HasAttributes.php", "line": 323, "function": "getAttributeValue", "class": "Illuminate\\Database\\Eloquent\\Model", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Eloquent\\Model.php", "line": 1527, "function": "getAttribute", "class": "Illuminate\\Database\\Eloquent\\Model", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\spinen\\laravel-clickup\\src\\Concerns\\HasClickUp.php", "line": 43, "function": "__get", "class": "Illuminate\\Database\\Eloquent\\Model", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\spinen\\laravel-clickup\\src\\Concerns\\HasClickUp.php", "line": 59, "function": "clickup", "class": "App\\Models\\User", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Eloquent\\Concerns\\HasAttributes.php", "line": 454, "function": "getClickupAttribute", "class": "App\\Models\\User", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Eloquent\\Concerns\\HasAttributes.php", "line": 350, "function": "mutateAttribute", "class": "Illuminate\\Database\\Eloquent\\Model", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Eloquent\\Concerns\\HasAttributes.php", "line": 323, "function": "getAttributeValue", "class": "Illuminate\\Database\\Eloquent\\Model", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Eloquent\\Model.php", "line": 1527, "function": "getAttribute", "class": "Illuminate\\Database\\Eloquent\\Model", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\app\\Http\\Controllers\\Api\\ClickUpController.php", "line": 17, "function": "__get", "class": "Illuminate\\Database\\Eloquent\\Model", "type": "->" }, { "function": "index", "class": "App\\Http\\Controllers\\Api\\ClickUpController", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Controller.php", "line": 54, "function": "call_user_func_array" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\ControllerDispatcher.php", "line": 45, "function": "callAction", "class": "Illuminate\\Routing\\Controller", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php", "line": 219, "function": "dispatch", "class": "Illuminate\\Routing\\ControllerDispatcher", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php", "line": 176, "function": "runController", "class": "Illuminate\\Routing\\Route", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php", "line": 681, "function": "run", "class": "Illuminate\\Routing\\Route", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 130, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Middleware\\SubstituteBindings.php", "line": 41, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 171, "function": "handle", "class": "Illuminate\\Routing\\Middleware\\SubstituteBindings", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Middleware\\ThrottleRequests.php", "line": 59, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 171, "function": "handle", "class": "Illuminate\\Routing\\Middleware\\ThrottleRequests", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\app\\Http\\Middleware\\Authenticate.php", "line": 14, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 171, "function": "handle", "class": "App\\Http\\Middleware\\Authenticate", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 105, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php", "line": 683, "function": "then", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php", "line": 658, "function": "runRouteWithinStack", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php", "line": 624, "function": "runRoute", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php", "line": 613, "function": "dispatchToRoute", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php", "line": 170, "function": "dispatch", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 130, "function": "Illuminate\\Foundation\\Http\\{closure}", "class": "Illuminate\\Foundation\\Http\\Kernel", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\barryvdh\\laravel-debugbar\\src\\Middleware\\InjectDebugbar.php", "line": 65, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 171, "function": "handle", "class": "Barryvdh\\Debugbar\\Middleware\\InjectDebugbar", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\fideloper\\proxy\\src\\TrustProxies.php", "line": 57, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 171, "function": "handle", "class": "Fideloper\\Proxy\\TrustProxies", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest.php", "line": 21, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 171, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest.php", "line": 21, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 171, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize.php", "line": 27, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 171, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode.php", "line": 63, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 171, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 105, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php", "line": 145, "function": "then", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php", "line": 110, "function": "sendRequestThroughRouter", "class": "Illuminate\\Foundation\\Http\\Kernel", "type": "->" }, { "file": "C:\\wamp64\\www\\kheops\\public\\index.php", "line": 55, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Kernel", "type": "->" } ] }

I manually added the token on my user but nothing does anything about it I still have this error.

jimmypuckett commented 4 years ago

From these error, there is not a way to help. I you want to put up some example code, then we can dig into it.

However, I have a bit of a guess from the logs, as it appears that there is some issue with your encryption/decryption. I would make sure that you can encrypt & decrypt. The API key is saved encrypted in the DB. Being that you ?manually" saved it, then if you just inserted it as an unencrypted string, that will be the issue.

I am closing this at this time as it feels more support than issues with the framework.

Please feel free to post more questions/info & we will try to help.