Charon.TokenPlugs.PutAssigns (Charon v4.1.0)

View Source

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

The following is assigned by default:

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.