anchor.diff:  
   
   %% @private
  --spec encode_invite_token(map()) -> invite_token().
  -encode_invite_token(Desc) ->
  +-spec encode_invite_token(token_params()) -> invite_token().
  +encode_invite_token(#{nonce := Nonce, cluster_host := ClusterHost}) ->
  +    Payload = base64:encode(json_utils:encode(#{
  +        <<"nonce">> => Nonce,
  +        <<"clusterHost">> => list_to_binary(ClusterHost)
  +    })),
       onepanel_utils:join(
  -        [?ONEPANEL_INVITE_TOKEN_PREFIX, base64:encode(json_utils:encode(Desc))],
  +        [?ONEPANEL_INVITE_TOKEN_PREFIX, Payload],
           <<?ONEPANEL_TOKEN_SEPARATOR>>
       ).
   
   
   %% @private
  --spec decode_invite_token(invite_token()) -> map().
  +-spec decode_invite_token(invite_token()) -> token_params() | no_return().
   decode_invite_token(InviteToken) ->
  -    [<<?ONEPANEL_INVITE_TOKEN_PREFIX>>, Desc] = string:split(
  -        InviteToken, ?ONEPANEL_TOKEN_SEPARATOR, all
  -    ),
  -    json_utils:decode(base64:decode(Desc)).
  +    try
  +        [<<?ONEPANEL_INVITE_TOKEN_PREFIX>>, Payload] = string:split(
  +            InviteToken, ?ONEPANEL_TOKEN_SEPARATOR, all
  +        ),
  +        json_utils:decode(base64:decode(Payload))
  +    of
  +        #{<<"nonce">> := Nonce, <<"clusterHost">> := ClusterHostBin} ->
  +            #{
  +                nonce => Nonce,
  +                cluster_host => binary_to_list(ClusterHostBin)
  +            };
  +        _ ->
  +            throw(?ERROR_TOKEN_INVALID)
  +    catch _:_ ->
  +        throw(?ERROR_TOKEN_INVALID)
  +    end.
  
positive.code: 
  -spec get_nonce(invite_token()) -> authorization_nonce:nonce().
  get_nonce(InviteToken) ->
      maps:get(<<"nonce">>, decode_invite_token(InviteToken)).
  
  
  -spec get_cluster_host(invite_token()) -> service:host().
  get_cluster_host(InviteToken) ->
      binary_to_list(maps:get(<<"clusterHost">>, decode_invite_token(InviteToken))).
  
  
  %%%===================================================================
  
negative.code: -author("Bartosz Walkowicz").
  
  -include("authentication.hrl").
  -include_lib("ctool/include/errors.hrl").
  
  -type invite_token() :: binary().
  
  