Comments (8)
Unfortunately this is definitely a bug that I need to fix and include a spec for, based on my testing. Thanks for letting me know, and I'm glad you were able to find a workaround in the meantime.
from sentinel.
Thanks for sending this my way. I'll see if I can take a look at it in the next couple days.
Depending on if you need API support or not you may also want to look at Coherence.
from sentinel.
Thanks! I was hoping it was just a configuration problem. I might go back to where the email is converted to html/text and see whether that's where it fails, will update here with what I find.
from sentinel.
I used iex to pry inside of confirmable_and_invitable
and set up the context to render the template, this is what that looked like:
email = Mailer.send_invite_email(updated_user, {confirmation_token, password_reset_token})
template = email.private.view_template
assigns = email.assigns
IEx.pry
I noticed in the source for bamboo that the template is rendered this way Phoenix.View.render_to_string(email.private.view_module,template,assigns)
So I did that used that to try the render, which gave the this stack-trace:
** (Protocol.UndefinedError) protocol Phoenix.Param not implemented for []
(phoenix) lib/phoenix/param.ex:125: Phoenix.Param.Any.to_param/1
(myapp) web/router.ex:1: MyApp.Router.Helpers.user_path/4
(myapp) web/router.ex:1: MyApp.Router.Helpers.user_url/4
(sentinel) lib/sentinel/templates/email/invite.html.eex:6: Sentinel.EmailView."invite.html"/1
(phoenix) lib/phoenix/view.ex:335: Phoenix.View.render_to_iodata/3
(phoenix) lib/phoenix/view.ex:342: Phoenix.View.render_to_string/3
(stdlib) erl_eval.erl:670: :erl_eval.do_apply/6
(iex) lib/iex/evaluator.ex:135: IEx.Evaluator.handle_eval/6
(iex) lib/iex/evaluator.ex:128: IEx.Evaluator.do_eval/4
(iex) lib/iex/evaluator.ex:108: IEx.Evaluator.eval/4
(iex) lib/iex/evaluator.ex:27: IEx.Evaluator.loop/3
(iex) lib/iex/evaluator.ex:18: IEx.Evaluator.init/3
(iex) lib/iex.ex:439: IEx.pry/3
After looking in the invite.html
template I copied this line into iex which resulted in the same stacktrace, so that seems to be the source of my problem:
Sentinel.RouterHelper.helpers.user_url(Sentinel.RouterHelper.endpoint, :invited)
from sentinel.
I was able to solve of that error by changing my invited path in my router from get "/users/:id/invited", UserController, :invited
to get "/users/invited", UserController, :invited
. Now the template renders, but still without any invite link:
pry(1)> Phoenix.View.render_to_string(email.private.view_module,template,assigns)
"<p>Hello [email protected]!</p>\n\n<p>You've been invited to MyApp</p>\n"
from sentinel.
@MatthewRDodds sorry about the delay, I haven't forgotten about this. My schedule has finally permitted me to take a look. I'm able to replicate the issue, and I'm working on a fix for it. Unfortunately as you can likely guess I don't have a timeframe on it just yet.
from sentinel.
No worries, thanks for the update @britton-jb! I ended up going ahead and writing my own app specific invite routine. Maybe it was something to do with my local configuration or implementation, in that case it might be good to close this for now and see if other people have trouble.
from sentinel.
Fixed in the v2 branch, which should have a 2.0.0 release in the coming week.
from sentinel.
Related Issues (20)
- Compilation error on file web/router.ex == HOT 3
- example sentinel app HOT 4
- Ueberauth JSON API HOT 3
- Ability to generate controllers and views during installation HOT 3
- Error while visiting sentinel paths HOT 7
- Error compiling - no function clause matching in Keyword.merge/2 HOT 1
- Error when using it inside an umbrella HOT 2
- Detail Mix Install Task Steps
- Document example a few example API requests HOT 4
- Disable confirmation
- Custom redirect paths HOT 7
- ** (Mix) The task "sentinel.gen.views" could not be found HOT 3
- with statement in Sentinel.Controllers.Html.AuthController.new_user has no else clause
- Guardian V1 Support HOT 3
- Question: Feature testing with Wallaby and ExMachina HOT 2
- Code Error when authenticating through third party provider (i.e. Github)
- Issues using with phoenix 1.3.0 HOT 4
- Uberauthenticator duplicate function with different bodies HOT 1
- Token Customization HOT 1
- Custom Model integration
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sentinel.