:relfileprefix: ../../../ [#boost-urls-url-remove_password] == xref:boost.adoc[pass:[boost]]::xref:boost/urls.adoc[pass:[urls]]::xref:boost/urls/url.adoc[pass:[url]]::remove_password Remove the password === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost/urls/url.adoc[url]& remove_password() noexcept; ---- === Description This function removes the password from the userinfo if a password exists. If there is no userinfo or no authority, the call has no effect. [NOTE] The interpretation of the userinfo as individual user and password components is scheme-dependent. Transmitting passwords in URLs is deprecated. [,cpp] ---- assert( url( "http://user:pass@example.com" ).remove_password().authority().buffer() == "user@example.com" ); ---- [,cpp] ---- this->has_password() == false && this->encoded_password().empty() == true ---- === Linear in `this->size()`. === Throws nothing. [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] === See Also xref:boost/urls/url_base/set_encoded_password.adoc[set_encoded_password] , xref:boost/urls/url_base/set_encoded_user.adoc[set_encoded_user] , xref:boost/urls/url_base/set_password.adoc[set_password] , xref:boost/urls/url_base/set_user.adoc[set_user] .