(RuntimeError)`module`未在Guardian管道中设置。如何解决这个问题?

问题描述 投票:0回答:1

我的项目的Github link

The Tutorial I am following

这是我的api终端错误(凤凰服务器)

[error] #PID<0.560.0> running Slicker.Endpoint terminated
Server: localhost:4000 (http)
Request: POST /api/users
** (exit) an exception was raised:
    ** (RuntimeError) `module` not set in Guardian pipeline
        lib/guardian/plug/pipeline.ex:240: Guardian.Plug.Pipeline.raise_error/1
        lib/guardian/plug/verify_header.ex:84: Guardian.Plug.VerifyHeader.call/2
        (slicker) web/router.ex:12: Slicker.Router.api/2
        (slicker) web/router.ex:1: Slicker.Router.match_route/4
        (slicker) web/router.ex:1: Slicker.Router.do_call/2
        (slicker) lib/slicker/endpoint.ex:1: Slicker.Endpoint.phoenix_pipeline/1
        (slicker) lib/plug/debugger.ex:123: Slicker.Endpoint."call (overridable 3)"/2
        (slicker) lib/slicker/endpoint.ex:1: Slicker.Endpoint.call/2
        (plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4
        (cowboy) /media/ankit/FE3055EB3055AB81/project/slicker/api/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4
reactjs elixir phoenix-framework phoenix guardian
1个回答
0
投票

我认为您需要将此添加到您的管道:

plug Guardian.Plug.Pipeline, module: App.Guardian, error_handler: App.Web.SessionController

您还应该检查您使用的是与本教程使用的Guardian相同的版本。与先前版本的库相比,他们对Guardian 1.0版本进行了许多更改。

© www.soinside.com 2019 - 2024. All rights reserved.