scambra / devise_invitable

An invitation strategy for devise
MIT License
2.66k stars 553 forks source link

Devise invitable getting wrong params #882

Closed victor00 closed 2 years ago

victor00 commented 2 years ago

What I'm getting after sending invite to the user: /users/invitation/accept.37?invitation=_token=3DpoDuVJ5EJcqmHAmbCJTz

What It should be: /users/invitation/accept.37?invitation_token=3DpoDuVJ5EJcqmHAmbCJTz

I tried to see if the problem was from routes, or maybe from the url but the url is being mounted this way:

<%= accept_invitation_url(@resource, invitation_token: @token) %>

scambra commented 2 years ago

where do you get that link? from email? are you using an email reader or looking at email on the log? It sounds to me like you are getting an equal sign at end of line, like this:

/users/invitation/accept.37?invitation= _token=3DpoDuVJ5EJcqmHAmbCJTz

That = at the end of line is a soft line break, an emai reader would join both lines removing the =

victor00 commented 2 years ago

I'm seeing that pattern at rails terminal after I do an invite. I did override only the invitations controller in order to pass new parameters and only invite users that email is not already at the database.

I found it strange because some projects that I did override the link isn't that way at the terminal and I can copy and paste it goes straight to registration without removing anything from the url.

I don't think I changed anything that could break the link from devise.

scambra commented 2 years ago

The link is good, you're seeing an email in rails terminal. You can get email on email reader to check it

victor00 commented 2 years ago

The link is good, you're seeing an email in rails terminal. You can get email on email reader to check it

Thank you so much, It's working as you said It should since I couldn't properly test the generated email I got confused by the url in the linux terminal. Sorry for the late response. And thanks again, I really appreciated your help.