** (UndefinedFunctionError) function Guardian.Plug.authenticated?/1 is undefined or private
up vote
0
down vote
favorite
I am very new to Elixir
and Phoenix
, I am trying to authenticate my application using :comeonin, "~> 4.0"
and :guardian, "~> 1.0"
and have a helper function that checks if the user is logged in:
defmodule Chatter.ViewHelper do
def current_user(conn), do: Guardian.Plug.current_resource(conn)
def logged_in?(conn) do
Guardian.Plug.authenticated?(conn)
end
end
But I get this error:
** (UndefinedFunctionError) function Guardian.Plug.authenticated?/1 is undefined or private.
elixir phoenix-framework guardian
add a comment |
up vote
0
down vote
favorite
I am very new to Elixir
and Phoenix
, I am trying to authenticate my application using :comeonin, "~> 4.0"
and :guardian, "~> 1.0"
and have a helper function that checks if the user is logged in:
defmodule Chatter.ViewHelper do
def current_user(conn), do: Guardian.Plug.current_resource(conn)
def logged_in?(conn) do
Guardian.Plug.authenticated?(conn)
end
end
But I get this error:
** (UndefinedFunctionError) function Guardian.Plug.authenticated?/1 is undefined or private.
elixir phoenix-framework guardian
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am very new to Elixir
and Phoenix
, I am trying to authenticate my application using :comeonin, "~> 4.0"
and :guardian, "~> 1.0"
and have a helper function that checks if the user is logged in:
defmodule Chatter.ViewHelper do
def current_user(conn), do: Guardian.Plug.current_resource(conn)
def logged_in?(conn) do
Guardian.Plug.authenticated?(conn)
end
end
But I get this error:
** (UndefinedFunctionError) function Guardian.Plug.authenticated?/1 is undefined or private.
elixir phoenix-framework guardian
I am very new to Elixir
and Phoenix
, I am trying to authenticate my application using :comeonin, "~> 4.0"
and :guardian, "~> 1.0"
and have a helper function that checks if the user is logged in:
defmodule Chatter.ViewHelper do
def current_user(conn), do: Guardian.Plug.current_resource(conn)
def logged_in?(conn) do
Guardian.Plug.authenticated?(conn)
end
end
But I get this error:
** (UndefinedFunctionError) function Guardian.Plug.authenticated?/1 is undefined or private.
elixir phoenix-framework guardian
elixir phoenix-framework guardian
edited Nov 9 at 11:29
Sheharyar
43.5k10106158
43.5k10106158
asked Nov 9 at 11:13
Sabyasachi Ghosh
2,3611326
2,3611326
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
Guardian documentation doesn't properly reference some API calls since the upgrade to v1.0
. You need to call these functions from your custom MyApp.Guardian
implementation and not from the actual Guardian
module(s).
Assuming you followed the guide to implement MyApp.Guardian
, you need to call:
MyApp.Guardian.Plug.authenticated?(conn)
Thanks for your help, Found the solution :)
– Sabyasachi Ghosh
Nov 9 at 11:34
add a comment |
up vote
1
down vote
The error shows that you are trying to call the function without arguments:
(UndefinedFunctionError) function Guardian.Plug.authenticated?/0
/0
here means no arguments.
I am calling like this def logged_in?(conn) do Guardian.Plug.authenticated?(conn) end
– Sabyasachi Ghosh
Nov 9 at 11:20
Updated the Question
– Sabyasachi Ghosh
Nov 9 at 11:22
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
Guardian documentation doesn't properly reference some API calls since the upgrade to v1.0
. You need to call these functions from your custom MyApp.Guardian
implementation and not from the actual Guardian
module(s).
Assuming you followed the guide to implement MyApp.Guardian
, you need to call:
MyApp.Guardian.Plug.authenticated?(conn)
Thanks for your help, Found the solution :)
– Sabyasachi Ghosh
Nov 9 at 11:34
add a comment |
up vote
2
down vote
accepted
Guardian documentation doesn't properly reference some API calls since the upgrade to v1.0
. You need to call these functions from your custom MyApp.Guardian
implementation and not from the actual Guardian
module(s).
Assuming you followed the guide to implement MyApp.Guardian
, you need to call:
MyApp.Guardian.Plug.authenticated?(conn)
Thanks for your help, Found the solution :)
– Sabyasachi Ghosh
Nov 9 at 11:34
add a comment |
up vote
2
down vote
accepted
up vote
2
down vote
accepted
Guardian documentation doesn't properly reference some API calls since the upgrade to v1.0
. You need to call these functions from your custom MyApp.Guardian
implementation and not from the actual Guardian
module(s).
Assuming you followed the guide to implement MyApp.Guardian
, you need to call:
MyApp.Guardian.Plug.authenticated?(conn)
Guardian documentation doesn't properly reference some API calls since the upgrade to v1.0
. You need to call these functions from your custom MyApp.Guardian
implementation and not from the actual Guardian
module(s).
Assuming you followed the guide to implement MyApp.Guardian
, you need to call:
MyApp.Guardian.Plug.authenticated?(conn)
answered Nov 9 at 11:25
Sheharyar
43.5k10106158
43.5k10106158
Thanks for your help, Found the solution :)
– Sabyasachi Ghosh
Nov 9 at 11:34
add a comment |
Thanks for your help, Found the solution :)
– Sabyasachi Ghosh
Nov 9 at 11:34
Thanks for your help, Found the solution :)
– Sabyasachi Ghosh
Nov 9 at 11:34
Thanks for your help, Found the solution :)
– Sabyasachi Ghosh
Nov 9 at 11:34
add a comment |
up vote
1
down vote
The error shows that you are trying to call the function without arguments:
(UndefinedFunctionError) function Guardian.Plug.authenticated?/0
/0
here means no arguments.
I am calling like this def logged_in?(conn) do Guardian.Plug.authenticated?(conn) end
– Sabyasachi Ghosh
Nov 9 at 11:20
Updated the Question
– Sabyasachi Ghosh
Nov 9 at 11:22
add a comment |
up vote
1
down vote
The error shows that you are trying to call the function without arguments:
(UndefinedFunctionError) function Guardian.Plug.authenticated?/0
/0
here means no arguments.
I am calling like this def logged_in?(conn) do Guardian.Plug.authenticated?(conn) end
– Sabyasachi Ghosh
Nov 9 at 11:20
Updated the Question
– Sabyasachi Ghosh
Nov 9 at 11:22
add a comment |
up vote
1
down vote
up vote
1
down vote
The error shows that you are trying to call the function without arguments:
(UndefinedFunctionError) function Guardian.Plug.authenticated?/0
/0
here means no arguments.
The error shows that you are trying to call the function without arguments:
(UndefinedFunctionError) function Guardian.Plug.authenticated?/0
/0
here means no arguments.
answered Nov 9 at 11:17
denis.peplin
5,80333145
5,80333145
I am calling like this def logged_in?(conn) do Guardian.Plug.authenticated?(conn) end
– Sabyasachi Ghosh
Nov 9 at 11:20
Updated the Question
– Sabyasachi Ghosh
Nov 9 at 11:22
add a comment |
I am calling like this def logged_in?(conn) do Guardian.Plug.authenticated?(conn) end
– Sabyasachi Ghosh
Nov 9 at 11:20
Updated the Question
– Sabyasachi Ghosh
Nov 9 at 11:22
I am calling like this def logged_in?(conn) do Guardian.Plug.authenticated?(conn) end
– Sabyasachi Ghosh
Nov 9 at 11:20
I am calling like this def logged_in?(conn) do Guardian.Plug.authenticated?(conn) end
– Sabyasachi Ghosh
Nov 9 at 11:20
Updated the Question
– Sabyasachi Ghosh
Nov 9 at 11:22
Updated the Question
– Sabyasachi Ghosh
Nov 9 at 11:22
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53224664%2fundefinedfunctionerror-function-guardian-plug-authenticated-1-is-undefined%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown