[#boost-urls-url-remove_password] = xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/url.adoc[url]::remove_password :relfileprefix: ../../../ :mrdocs: Remove the password == Synopsis Declared in `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L439[boost/url/url.hpp]>` [source,cpp,subs="verbatim,replacements,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. == Example [,cpp] ---- assert( url( "http://user:pass@example.com" ).remove_password().authority().buffer() == "user@example.com" ); ---- == Postconditions [,cpp] ---- this->has_password() == false && this->encoded_password().empty() == true ---- == Complexity Linear in `this‐>size()`. == Exception Safety Throws nothing. == BNF [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- == Specification * https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[] == Return Value `*this` == See Also xref:boost/urls/url/set_encoded_password.adoc[`set_encoded_password`], xref:boost/urls/url/set_encoded_user.adoc[`set_encoded_user`], xref:boost/urls/url/set_password.adoc[`set_password`], xref:boost/urls/url/set_user.adoc[`set_user`]. [.small]#Created with https://www.mrdocs.com[MrDocs]#