becem-gharbi / nuxt-fcm

Firebase Cloud Messaging for Nuxt
MIT License
20 stars 2 forks source link

Can't subscribe to topic #14

Closed salimov7711 closed 7 months ago

salimov7711 commented 7 months ago

Hello Cant subscribe to topic { "url": "/api/fcm/topic/subscribe", "statusCode": 401, "statusMessage": "", "message": "unauthorized", "stack": "

<span class=\"stack internal\">at handleError (D:\V2\node_modules\@bg-dev\nuxt-fcm\dist\runtime\server\utils\error.mjs:7:19)\n<span class=\"stack internal\">at Object.handler (D:\V2\node_modules\@bg-dev\nuxt-fcm\dist\runtime\server\api\fcm\topic\subscribe.post.mjs:18:5)\n<span class=\"stack internal\">at Object.handler (/D:/V2/node_modules/h3/dist/index.mjs:2196:34)\n<span class=\"stack internal\">at /D:/V2/node_modules/h3/dist/index.mjs:1962:31\n<span class=\"stack internal\">at async Object.callAsync (/D:/V2/node_modules/unctx/dist/index.mjs:72:16)\n<span class=\"stack internal\">at async Server.toNodeHandle (/D:/V2/node_modules/h3/dist/index.mjs:2249:7)
" }

salimov7711 commented 7 months ago

Oh sorry ! I forgot to make a server middlware to get access to topic methods. Everything works perfect now

jochdev commented 7 months ago

Oh sorry ! I forgot to make a server middlware to get access to topic methods. Everything works perfect now

Could you share how you solved the problem?