MadelineProtoDocs/update2fa.html

11 lines
231 KiB
HTML
Raw Permalink Normal View History

2024-11-18 19:07:07 +01:00
<!DOCTYPE html><html lang="en-US"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=Edge"><title>update2fa</title><link rel="stylesheet" href="/assets/css/just-the-docs-dark.css?v=2"><link rel="preload" href="/assets/css/just-the-docs-light.css?v=2" as="style"> <script> if (window.localStorage.getItem('theme') === 'light') { document.querySelector('[rel="stylesheet"]').setAttribute('href', '/assets/css/just-the-docs-light.css'); } </script><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="google-site-verification" content="OIo7XVmU3hJT1uHL82H6-COTtQqeefBXIpZDznJPkOg" /><link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon.png"><link rel="icon" type="image/png" href="/favicons/favicon-32x32.png" sizes="32x32"><link rel="icon" type="image/png" href="/favicons/favicon-16x16.png" sizes="16x16"><link rel="manifest" href="/favicons/manifest.json"><link rel="mask-icon" href="/favicons/safari-pinned-tab.svg" color="#5bbad5"><link rel="shortcut icon" href="/favicons/favicon.ico"><meta name="msapplication-config" content="/favicons/browserconfig.xml"><title></title><meta property=og:title content=update2fa><meta property=og:locale content=en_US><meta name=description content="Update 2FA password"><meta property=og:description content="Update 2FA password"><link rel=canonical href=https://docs.madelineproto.xyz/update2fa.html><meta property=og:url content=https://docs.madelineproto.xyz/update2fa.html><meta property=og:type content=article><meta property=article:published_time content=2024-11-18T17:16:12+00:00><meta name=twitter:card content=summary><meta name=twitter:site content=@DaniilGentili><meta name=twitter:creator content=@DaniilGentili><script type=application/ld+json> {"@context":"http://schema.org","@type":"WebPage","author":{"@type":"Person","name":[{"Key":"twitter","Value":"DaniilGentili"}]},"description":"Update 2FA password","headline":"update2fa","url":"https://docs.madelineproto.xyz/update2fa.html"} </script> <script src="/assets/js/vendor/lunr.min.js" defer></script> <script type="text/javascript" src="/assets/js/just-the-docs.js?v=2" defer></script><body> <svg xmlns="http://www.w3.org/2000/svg" style="display: none;"> <symbol id="svg-link" viewBox="0 0 24 24"><title>Link</title><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path> </svg> </symbol> <symbol id="svg-search" viewBox="0 0 24 24"><title>Search</title><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"> <circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line> </svg> </symbol> <symbol id="svg-menu" viewBox="0 0 24 24"><title>Menu</title><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line> </svg> </symbol> <symbol id="svg-arrow-right" viewBox="0 0 24 24"><title>Expand</title><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline> </svg> </symbol> <symbol id="svg-doc" viewBox="0 0 24 24"><title>Document</title><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class=
</span></span><span class="line"><span class="cl"> <span class="nv">$MadelineProto</span><span class="o">-&gt;</span><span class="na">update2fa</span><span class="p">([</span><span class="s1">&#39;password&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;current password&#39;</span><span class="p">,</span> <span class="s1">&#39;new_password&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;New password&#39;</span><span class="p">,</span> <span class="s1">&#39;email&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;daniil@daniil.it&#39;</span><span class="p">,</span> <span class="s1">&#39;hint&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;ponies&#39;</span><span class="p">]);</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">RPCErrorException</span> <span class="nv">$e</span><span class="p">)</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="p">(</span><span class="nx">strpos</span><span class="p">(</span><span class="nv">$e</span><span class="o">-&gt;</span><span class="na">rpc</span><span class="p">,</span> <span class="s1">&#39;EMAIL_UNCONFIRMED_&#39;</span><span class="p">)</span> <span class="o">!==</span> <span class="k">false</span><span class="p">)</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nv">$Bool</span> <span class="o">=</span> <span class="nv">$MadelineProto</span><span class="o">-&gt;</span><span class="na">account</span><span class="o">-&gt;</span><span class="na">confirmPasswordEmail</span><span class="p">([</span><span class="s1">&#39;code&#39;</span> <span class="o">=&gt;</span> <span class="nv">$MadelineProto</span><span class="o">-&gt;</span><span class="na">readline</span><span class="p">(</span><span class="s1">&#39;Enter your email code: &#39;</span><span class="p">)]);</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="k">throw</span> <span class="nv">$e</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre></div></div><hr><footer><div class="d-flex mt-2"><p class="text-small text-grey-dk-000 mb-0"> <a target="_blank" href="https://github.com/danog/MadelineProtoDocs/edit/master/docs/update2fa.md" id="edit-this-page">Edit this page on GitHub</a></p></div></footer></div></div><a href="#" id="search-button" class="search-button"> <svg viewBox="0 0 24 24" class="icon"><use xlink:href="#svg-search"></use></svg> </a><div class="search-overlay"></div></div>