riverrun / phauxth

Not actively maintained - Authentication library for Phoenix, and other Plug-based, web applications
409 stars 20 forks source link

Mailer module name inconsistency after running `mix phauxth.new` with `--api --confirm` #95

Closed florish closed 5 years ago

florish commented 5 years ago

After posting #94 , I noticed another minor inconsistency in the code mix phauxth.new generates.

In this case, I ran mix phauxth.new --api --confirm, which also generates a Mailer module.

There are a couple of inconsistencies in this, of which I'm not sure what's the right name / location to use.

Examples given for an app named PhauxthTest:

  1. The module is located in the phauxth_test_web folder, but is named PhauxthTest.Mailer:
# File: /lib/phauxth_test_web/mailer.ex
defmodule PhauxthTest.Mailer do
  # ...
end
  1. In config/config.exs, this module is referred to as follows:
config :admin_panel, PhauxthTestWeb.Mailer,
  adapter: Bamboo.LocalAdapter

In config/test.exs, the Web suffix is omitted, however:

config :admin_panel, PhauxthTest.Mailer,
  adapter: Bamboo.TestAdapter

It's probably better to just pick one of these options :)

  1. In PhauxthTestWeb.Email, the Mailer is aliased without using the Web suffix (i.e. PhauxthTest.Mailer, not PhauxthTestWeb.Mailer). Whether or not this is a problem, depends on the decision made on what the correct module name and location should be.

As with #94, with some initial guidance from a maintainer, I'd be happy to create a pull request for this myself.

riverrun commented 5 years ago

Thanks for reporting this - I will fix it today or tomorrow and let you know when it's done.

riverrun commented 5 years ago

Fixed in the latest phauxth_installer