Giter Club home page Giter Club logo

Comments (6)

Gokul595 avatar Gokul595 commented on June 28, 2024

I haven't tried API Guard with ActionCable. Can you try including below modules and see how it works?

include ApiGuard::Resource
include ApiGuard::JwtAuth::JsonWebToken
include ApiGuard::JwtAuth::Authentication
include ApiGuard::JwtAuth::RefreshJwtToken
include ApiGuard::JwtAuth::BlacklistToken

from api_guard.

xxSkyy avatar xxSkyy commented on June 28, 2024

Somehow it helped, another error came

undefined local variable or method `controller_name' for #<ApplicationCable::Connection:0x000000012539efb0>

from api_guard.

Gokul595 avatar Gokul595 commented on June 28, 2024

Can you try calling the method decode(@token) directly instead of decode_token?

from api_guard.

xxSkyy avatar xxSkyy commented on June 28, 2024

It works now! Thanks.
Anyway before I'll close it - are there some update option to avoid these changes or should I use it as it is now?

from api_guard.

Gokul595 avatar Gokul595 commented on June 28, 2024

You can use it. I will try for the possibility to support action cable in API Guard and update here if I found anything. You can close this issue.

from api_guard.

xxSkyy avatar xxSkyy commented on June 28, 2024

Update:
I didnt notice before that with those includes ActionCable methods was overwritten and response wasnt hash with info , it was just JWT token I sent on handshake.

I figued out that its caused by some method from include ApiGuard::JwtAuth::JsonWebToken, so I closed it in class

  class Auth
      extend ApiGuard::JwtAuth::JsonWebToken
    end

and then to decode token used Auth.decode(@token) , after that so far it works.

from api_guard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.