# Generate token using simple form

**URL:** <https://forum.elixirforum.com/t/generate-token-using-simple-form/60995>\
**Category:** Questions\
**Tags:** phoenix, liveview\
**Created:** [January 15, 2024, 2:52pm UTC](https://forum.elixirforum.com/t/generate-token-using-simple-form/60995 "2024-01-15T14:52:08Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![polypush135](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/p/9dc877/32.png) [@polypush135](https://forum.elixirforum.com/u/polypush135)\
**Post date:** [January 15, 2024, 3:01pm UTC](https://forum.elixirforum.com/t/generate-token-using-simple-form/60995/2 "2024-01-15T15:01:31Z")

</div>

> [@dev-rroslan](#):
>
> warning: a map with atom keys was given to a form. Maps are always considered parameters and therefore must have string keys, got: %{country\_issued\_id: “”}

First issue:

Your map has atoms for keys not string literals.  
IE:  
You sent

```elixir
%{country_issued_id: “”}

```

it wants

```elixir
%{"country_issued_id" => “”}

```

Because they are parameters are possibly coming in from outside and someone could possible run out of atoms causing their app to crash. Or put another way there would be no way to limit the number of atoms the system could possibly have to make if anyone can just submit the form and pass in a new key in the form of an atom. Thus why they warning you to use strings.

Also try to look up how to use the ` char in these posts to format your code sections. It will help others read it better.

The next warning is self explanatory. You are not using the thing thus either annotate it with a prefix of `_`or remote it

heres you issue.

```elixir
{:ok,
assign(socket,
form: to_form(%{country_issued_id: “”})
)}

```

should look like

```elixir
{:ok,
assign(socket,
form: to_form(%{"country_issued_id" => “”})
)}

```

Your to\_form function is taking a map that has an atom.

At the end of the day these are just warnings.

---

_[View the full topic](https://forum.elixirforum.com/t/generate-token-using-simple-form/60995)._
