Skip to content

Commit

Permalink
make user id email binary
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT committed Jun 20, 2014
1 parent 73c66fe commit 498c673
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/avz.erl
Expand Up @@ -12,8 +12,8 @@ buttons(Methods) -> [ M:login_button() || M <- Methods].
event(init) -> [];
event(logout) -> wf:user(undefined), wf:redirect(?LOGIN_PAGE);
event(to_login) -> wf:redirect(?LOGIN_PAGE);
event({register, #user{}=U}) -> kvs:add(U), login_user(U);
event({login, #user{}=U}) -> login_user(U);
event({register, #user{}=U}) -> kvs:add(U), login_user(U); % sample
event({login, #user{}=U}) -> login_user(U); % sample
event({Method,Event}) -> Method:event({Method,Event});
event(Ev) -> error_logger:info_msg("Page Event ~p",[Ev]).

Expand Down
2 changes: 1 addition & 1 deletion src/facebook.erl
Expand Up @@ -33,7 +33,7 @@ registration_data(Props, facebook, Ori)->
register_date = erlang:now(),
status = ok }.

email_prop(Props, _) -> binary_to_list(proplists:get_value(<<"email">>, Props)).
email_prop(Props, _) -> proplists:get_value(<<"email">>, Props).

login_button() -> #panel{class=["btn-group"], body=
#link{id=loginfb, class=[btn, "btn-primary", "btn-large", "btn-lg"],
Expand Down
2 changes: 1 addition & 1 deletion src/google.erl
Expand Up @@ -28,7 +28,7 @@ registration_data(Props, google, Ori)->
sex = proplists:get_value(<<"gender">>, Props),
status = ok }.

email_prop(Props, _) -> binary_to_list(proplists:get_value(<<"email">>, Props)).
email_prop(Props, _) -> proplists:get_value(<<"email">>, Props).

login_button()-> #panel{id=plusloginbtn, class=["btn-group"], body=
#link{class=[btn, "btn-google-plus", "btn-large","btn-lg"],
Expand Down
2 changes: 1 addition & 1 deletion src/microsoft.erl
Expand Up @@ -36,7 +36,7 @@ registration_data(Props, microsoft, Ori)->
sex = proplists:get_value(<<"gender">>, Props),
status = ok }.

email_prop(Props, _) -> binary_to_list(proplists:get_value(<<"id">>, Props)) ++ "@microsoft".
email_prop(Props, _) -> proplists:get_value(<<"id">>, Props).

login_button()-> #panel{class=["btn-group"], body=
#link{id=microsoftbtn, class=[btn, "btn-microsoft", "btn-large"],
Expand Down
2 changes: 1 addition & 1 deletion src/twitter.erl
Expand Up @@ -24,7 +24,7 @@ registration_data(Props, twitter, Ori)->
register_date = erlang:now(),
status = ok }.

email_prop(Props, twitter) -> binary_to_list(proplists:get_value(<<"screen_name">>, Props)) ++ "@twitter".
email_prop(Props, twitter) -> proplists:get_value(<<"screen_name">>, Props).

callback() ->
Token = wf:q(<<"oauth_token">>),
Expand Down

0 comments on commit 498c673

Please sign in to comment.