anchor.diff:              end
       end.
   
  -generate_token() ->
  +generate_id_and_token() ->
       Random = integer_to_binary(erlang:system_time(microsecond)),
  +    Uid = <<Random/binary, "@", (node_name_to_binary())/binary>>,
       case {application:get_env(spread, jwt_key), application:get_env(spread, jwt_iss)} of
           {undefined, undefined} ->
  -            <<"anonymous">>;
  +            Uid;
           {{ok, Key}, {ok, Iss}} ->
               Claims = [
                   {<<"iss">>, Iss},
  -                {<<"uid">>, <<Random/binary, "@", (node_name_to_binary())/binary>>}
  +                {<<"uid">>, Uid}
               ],
               {ok, Token} = jwt:encode(<<"HS256">>, Claims, Key),
  -            Token %% Tokens never expire
  +            jsx:encode([{<<"uid">>, Uid}, {<<"token">>, Token}]) %% Tokens never expire
       end.
   
   init(Req, State) ->
  
positive.code:     cowboy_req:reply(405, Req).
  
  node_name_to_binary() ->
      re:replace(atom_to_list(node()),"@","",[{return, binary}]).
  
  -ifdef(TEST).
  auth_test() ->
  
negative.code: 
  maybe_process(Req, State, <<"POST">>) ->
      {ok, cowboy_req:reply(200, #{
          <<"content-type">> => <<"application/json; charset=utf-8">>,
          <<"access-control-allow-origin">> => <<"*">>
      } , generate_id_and_token(), Req), State};
  maybe_process(Req, State, <<"OPTIONS">>) ->
      {ok, cowboy_req:reply(200, #{
          <<"content-type">> => <<"text/plain; charset=utf-8">>,
  