# `Charon.TokenPlugs.PutAssigns`
[🔗](https://github.com/weareyipyip/charon/blob/v4.3.0/lib/charon/token_plugs/put_assigns.ex#L1)

After verifying everything you would want to verify about a token,
assign data to the conn.

The following is assigned by default:
- `:user_id` (bearer token claim "sub")
- `:session_id` (bearer token claim "sid")
- `:token_payload`
- `:session` (if fetched with `Charon.TokenPlugs.load_session/2`)

All of the assign names are overridable:

    # assign the user ID to key :current_user_id
    plug PutAssigns, claims: %{"sub" => :current_user_id, "sid" => :session_id}

This plug is skipped if an authentication error is present.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
