Giter VIP home page Giter VIP logo

sorcery-jwt's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sorcery-jwt's Issues

Sorcery-jwt should support sorcery 0.16.x until sorcery 1.0 is released

in Gemfile:

gem 'sorcery', '~> 0.16'
bundle update sorcery
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Bundler could not find compatible versions for gem "sorcery":
  In Gemfile:
    sorcery (~> 0.16)

    sorcery-jwt was resolved to 0.1.12, which depends on
      sorcery (>= 0.13, < 0.16)

Sorcery resolved ruby 2.7.x deprecation warnings (among other things) starting in version 0.16.0: https://github.com/Sorcery/sorcery/releases/tag/v0.16.0
Sorcery/sorcery#241

I realize https://github.com/Sorcery/sorcery-rework will support jwt, but appears to be stalled. Can we catch up with core sorcery in the meantime?

Thanks so much for all your JWT work!

How to logoff/logout or expire a JWT Token (not expire) ?

I tried to log out using the sorcery method (logout) but it just updates some columns from the user but if I continue using the JWT token it will be valid until it expired by the date, not respecting the logout method.
Any idea?

undefined method `login_and_issue_token'

Hi,

I have a simple setup of sorcery and sorcery-jwt with following details.


Rails.application.config.sorcery.submodules = [:jwt, :reset_password, :user_activation, :activity_logging]
.....
.....
.....

config.user_config do |user|
   user.jwt_secret = Rails.application.credentials.dig(Rails.env.to_sym, :jwt_key)
    user.jwt_algorithm = 'HS256' # HS256 is used by default.
end

On controller

class ApiController < ActionController::API
end

class TokensController < ApiController
  def create
    token = login_and_issue_token(params[:email], params[:password])
    json_response(token, 200)
  end
end

When controller action is called it throw following error.

NoMethodError: undefined method `login_and_issue_token' for #\u003cTokensController:0x00007ffbd60a0b20\u003e\u003e"

Retrieve token

If I already have a user, say from an oauth login, is it possible to retrieve the token for that user?

I tried @token = login_and_issue_token(@user.email, @user.crypted_password)
but that just returns nil.

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.