I am also having the same problem where the very presence of the
before_(_,_,_) causes problems.
It seems an error happends in the auth check and the redirect failes to work
controler call:
dashboard('GET', [], Account) -> {ok,[{}]}
*.*
%%run this before letting a user do stuffbefore_(_, _, _) ->
user_lib:require_login(Req)
*.user_lib function*
require_login(Req) -> *case *Req:cookie("session_id") *of
* undefined -> {ok, [{controller, "user"}, {action, "login"}]}; Sess ->
*case *Req:cookie("user_id") *of
* Id -> *case *boss_db:find(Id) *of
* Account -> *try *Account:session_identifier() *of
* Identifier -> *case *Sess =:= Identifier *of
* false -> {ok, [{controller, "user"}, {action, "login"}]};
true -> {ok, Account} *end
** catch
* _:Msg -> {redirect, [{controller, "user"}, {action, "login"},
{error_message, Msg}]} *end
** end*; undefined -> {redirect, [{controller, "user"},
{action, "login"}]} *end*; undefined -> {redirect, [{controller,
"user"}, {action, "login"}]}
*end., Note , the code here is contined effort to get the app to wrok ..... i
get too may redirect errors in chrome*
On Tuesday, November 12, 2013 12:46:22 PM UTC-4, Lucas Introne wrote:
>
> hi jim,
>
> things have recently changed, and the tutorial hasn't yet been updated to
> match. the before filters are indeed expected to return a proplist. check
> out the documentation here:
> https://github.com/evanmiller/ChicagoBoss/blob/master/README_FILTERS.md
>
> hope this helps,
> -lucas-
>
> On Friday, November 1, 2013 2:13:48 PM UTC-4, jim rosenblum wrote:
>>
>> Again, just the presence of that before_/3 causes the error. Even when my
>> Action doesn't make use of the function, I get the error...
>>
>>
>> On Fri, Nov 1, 2013 at 1:32 PM, kotedo <[email protected]> wrote:
>>
>>> This is how I usually do the pattern match:
>>>
>>> before_(Action,_,_) ->
>>> case Action of
>>> "customers" ->
>>> user_lib:require_login(Req);
>>> _ ->
>>> %% Do something else or nothing ..
>>>
>>> {ok, [{dummy, Dummy}]}
>>> end.
>>>
>>> otherwise ...
>>> before_(“customers”, _, _) ->
>>> .... code ...
>>> last line of code;
>>> before_(_,_,_) ->
>>> ... code ...
>>> last line of code and last line of pattern match . %% <— Note the
>>> period? End of pattern match
>>>
>>> On Nov 1, 2013, at 12:22, jim rosenblum <[email protected]> wrote:
>>>
>>> user_lib:require_login(Req).
>>>
>>>
>>>
>>
--
You received this message because you are subscribed to the Google Groups
"ChicagoBoss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at http://groups.google.com/group/chicagoboss.
To view this discussion on the web visit
https://groups.google.com/d/msgid/chicagoboss/dd041da6-3fa1-40c8-bde6-dad9fc5fa597%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.