anchor.diff:              case verify_token_response(TokenValue, JSON) of
                   {error, Error}        -> {error, Error};
                   {ok, Username, false} -> {error, "{\"error\": \"Token not valid. Expended by other system\"}"};
  -                {ok, Username, true}  -> users:replace_access_token(Username, TokenValue)
  +                {ok, Username, true}  -> users:replace_token(Username, TokenName, TokenValue)
               end
       end.
   
  
positive.code: 
  
  -spec authenticate_request(ReqData::tuple()) -> tuple().
  authenticate_request(ReqData) -> authenticate_token("access_token", ReqData).
  
  
  -spec authenticate_token(TokenName::string(), ReqData::tuple()) -> tuple().
  authenticate_token(TokenName, ReqData) ->
      case wrq:get_req_header(TokenName, ReqData) of
          undefined -> {error, "{\"error\": \"Not possible to perform the request. Missing " ++ TokenName ++ "\"}"};
          TokenVal  -> check_valid_token(TokenName, list_to_binary(TokenVal))
      end.
  
  
  
negative.code: 
  -spec auth_gen_token(Code::string(), AuthState::string()) -> string().
  auth_gen_token(Code, AuthState) ->
      {AccToken, RefreshT} = exchange_token(Code, AuthState),
  
      RefToken = case RefreshT of
          undefined -> list_to_binary("undefined");
          String    -> list_to_binary(string:substr(binary_to_list(String), 3))
      end,
  