Skip to content

Commit

Permalink
Handle undefined as a value for non set cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderWingard committed Nov 25, 2010
1 parent 3b8be93 commit ccf5d08
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions site/src/login.erl
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,6 @@ cookie_login() ->
end.

logout() ->
wf:cookie(username, ""),
wf:cookie(password, ""),
wf:cookie(username, undefined),
wf:cookie(password, undefined),
wf:logout().
3 changes: 3 additions & 0 deletions site/src/umts_db.erl
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ sort(Colors)->
X <- Colors,
lists:member(X,C#cards.color)].

login(Name, Password) when Name == undefined;
Password == undefined ->
not_found;
login(Name, Password) ->
Q = qlc:q([U#users.id || U <- mnesia:table(users),
U#users.name == string:to_lower(Name),
Expand Down

0 comments on commit ccf5d08

Please sign in to comment.