Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User should be able to provide token size #17

Closed
wants to merge 3 commits into from

Conversation

przbadu
Copy link

@przbadu przbadu commented Dec 7, 2015

UPDATE

  1. User should be able to provide required token size
  2. Default size will be 24 char long

Usecase:

class User < ActiveRecord::Base
  has_secure_token   # default token size is 24
  has_secure_token :auth_secret, token_size: 50 # auth_secret token size is 50
end
user = User.new
user.save
user.token # => 'pX27zsMN2ViQKta1bGfLmVJE'
user.auth_secret # => '7vUrfsD6K9GazaY8J7Acxsw3E6wU93TMe9DHWuNe5yj9yfwneB'

Added test cases and tested on my ongoing project, working as expected.

Also check: issue-10

Updated README

Use latest bundler version in CI

@przbadu
Copy link
Author

przbadu commented Dec 7, 2015

Updated README file for PR-17

@przbadu
Copy link
Author

przbadu commented Dec 7, 2015

this is what I found when trying to debug above travis-ci failing issue: rubygems/bundler#3558. Could you please update latest bundler version in CI?

@przbadu
Copy link
Author

przbadu commented Dec 7, 2015

Use latest bundler version in CI

@przbadu
Copy link
Author

przbadu commented Dec 7, 2015

FIXED....failing travis-error: before bundle install use latest bundler version in CI: follow rubygems/bundler#3558 for more information

@robertomiranda
Copy link
Owner

@przbadu since this is still a back port gem, could you open this PR on https://github.com/rails/rails?

@przbadu przbadu mentioned this pull request Dec 8, 2015
@przbadu
Copy link
Author

przbadu commented Dec 8, 2015

Okay, got it, it is now ActiveRecord::SecureToken, https://github.com/rails/rails/blob/master/activerecord/lib/active_record/secure_token.rb .... I will make PR this weekend

Thanks Robert

@rohitnick
Copy link

@przbadu : check this PR #11

@fredngo
Copy link

fredngo commented Apr 13, 2016

Was a Pull Request ever filed with the main Rails project for this feature?

@przbadu
Copy link
Author

przbadu commented Apr 13, 2016

@rohitnick: 👍

Right I missed your pull request, I was on hurry to implement this feature. I just referenced your PR in rails/rails#24531

Thanks

@przbadu
Copy link
Author

przbadu commented Apr 13, 2016

@fredngo: I just made a rails/rails#24531

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants