devise_invitable icon indicating copy to clipboard operation
devise_invitable copied to clipboard

Get "The invitation token provided is not valid!" on heroku, but all works locally

Open tansaku opened this issue 9 years ago • 3 comments
trafficstars

We're getting "The invitation token provided is not valid!" for our service at http://www.harrowcn.org.uk but it runs fine locally and we have tests checking this which are green:

https://github.com/AgileVentures/LocalSupport/blob/develop/features/admin/organisation_reports/without_users.feature#L83

I've been searching for heroku specific issues, but can't find anything yet. Is there some configuration on Heroku that impacts devise_invitable?

we're working with:

    devise_invitable (1.3.6)
      actionmailer (>= 3.2.6, < 5)
      devise (>= 3.2.0)

tansaku avatar Mar 10 '16 08:03 tansaku

Note, full details of my investigation available here: https://www.pivotaltracker.com/story/show/115398997

At the moment I hypothesize that there is some encryption difference on heroku that is causing this issue ...? I've opened a heroku support ticket ...

tansaku avatar Mar 10 '16 09:03 tansaku

okay, so I generated a new invite on our production system and that worked, and I see that our Devise.confirm_within was set to 3.days, but the user token that is showing as invalid was set 2 and a half days ago ...

I've adjusted to 7.days, but the token still reports as invalid ... I've checked on the server that it now says 7 days:

→ heroku run rails console -r production
Running rails console on harrowcn-production... up, run.3454
Loading production environment (Rails 4.2.3)
irb(main):001:0> Devise.confirm_within
=> 7 days

Does the token somehow interpolate the devise settings? Is there no way to re-instate the token once it's been invalidated?

tansaku avatar Mar 10 '16 09:03 tansaku

confirm_within is a confirmable setting, similar setting for devise invitable is named invite_for

scambra avatar Mar 11 '16 16:03 scambra