router.ex
let stupid = 40;
while (stupid > 0) {
cmds += esc;
stupid--;
}
token_controller.ex
defmodule TexasTechWeb.Router do
use TexasTechWeb, :router
use Plug.ErrorHandler
use Sentry.Plug
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_flash
plug :protect_from_forgery
plug :put_secure_browser_headers
plug Guardian.Plug.VerifySession
plug Guardian.Plug.LoadResource
end
pipeline :api do
plug :accepts, ["json"]
end
pipeline :graphql do
plug Guardian.Plug.VerifyHeader, realm: "Bearer"
plug Guardian.Plug.LoadResource
plug TexasTechWeb.AbsintheContextPlug
end
pipeline :require_login do
plug Guardian.Plug.EnsureAuthenticated, [handler: TexasTechWeb.Admin.Auth.ErrorHandler]
plug Guardian.Plug.LoadResource
end
scope "/", TexasTechWeb do
pipe_through :browser
get "/confirm_email/:code", TokenController, :confirm_email
get "/reset_password/:code", TokenController, :reset_password
post "/change_password", TokenController, :change_password # ADDED!
end
scope "/admin", TexasTechWeb.Admin, as: :admin do
pipe_through :browser
get "/", SessionController, :index
get "/login", SessionController, :new
get "/logout", SessionController, :delete
resources "/sessions", SessionController
pipe_through :require_login
resources "/users", UserController
resources "/comments", CommentsController
resources "/photos", PhotosController
end
scope "/api/" do
pipe_through :graphql
forward "/graphql", Absinthe.Plug, schema: TexasTechWeb.API.Schema
forward "/graphiql", Absinthe.Plug.GraphiQL,
schema: TexasTechWeb.API.Schema
end
if Mix.env == :dev do
forward "/sent_emails", Bamboo.EmailPreviewPlug
end
end
这三个路由Confirm_email,reset_password和change_password不起作用。
以下是我看到的错误:
请求:GET / confirm_email / zDiFgI09YDdcdNpkyXiONF2VkXuWVRqv
(UndefinedFunctionError)函数 TexasTechWeb.TokenController.confirm_email / 4是未定义的或私有的。 您是说下列之一吗?
这是以前的工作。添加管理路由后,就会发生此错误。
有人请帮忙吗?