What is the correct place to put Guardian files in a typical Phoenix directory structure?

The three files I am confused about are

  1. Guardian implementation module Link
  2. Guardian pipeline Link
  3. Guardian pipeline Error handler Link

I have seen different guides put these files in different locations. The official guide puts these in the context folder alongside user.ex model. Where as, other guides put these in the project’s web directory. What and why is the correct approach ?

There is no “correct” approach because Elixir does not force any file structure.

You can put them wherever it suits the best for You.

I personally put those kind of files inside web… because I don’t want to add them to my domain.