Skip to content

Commit

Permalink
Updated documentation for MFA support on API.html
Browse files Browse the repository at this point in the history
  • Loading branch information
d-woosley committed Aug 8, 2024
1 parent c6ae5bd commit 726dec4
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions documentation/html/pwndocapi/API.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ <h1 class="title">Module <code>pwndocapi.API</code></h1>
self.verbose = verbose
self.user = {&#34;token&#34;: &#34;&#34;, &#34;refreshToken&#34;: &#34;&#34;}

def login(self, username, password):
def login(self, username, password, totp=&#34;&#34;):
r = self.session.post(
self.target + &#34;/api/users/token&#34;,
json={&#34;username&#34;: username, &#34;password&#34;: password, &#34;totpToken&#34;: &#34;&#34;},
json={&#34;username&#34;: username, &#34;password&#34;: password, &#34;totpToken&#34;: totp},
verify=False
)
if r.json()[&#34;status&#34;] == &#34;success&#34;:
Expand Down Expand Up @@ -287,10 +287,10 @@ <h2 class="section-title" id="header-classes">Classes</h2>
self.verbose = verbose
self.user = {&#34;token&#34;: &#34;&#34;, &#34;refreshToken&#34;: &#34;&#34;}

def login(self, username, password):
def login(self, username, password, totp=&#34;&#34;):
r = self.session.post(
self.target + &#34;/api/users/token&#34;,
json={&#34;username&#34;: username, &#34;password&#34;: password, &#34;totpToken&#34;: &#34;&#34;},
json={&#34;username&#34;: username, &#34;password&#34;: password, &#34;totpToken&#34;: totp},
verify=False
)
if r.json()[&#34;status&#34;] == &#34;success&#34;:
Expand All @@ -304,7 +304,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
self.loggedin = True
elif r.json()[&#34;status&#34;] == &#34;error&#34;:
if self.verbose:
print(&#34;[!] Login error. (%s)&#34; % r.json()[&#34;status&#34;])
print(&#34;[!] Login error. (%s)&#34; % r.json()[&#34;datas&#34;])
self.loggedin = False
return self.loggedin

Expand Down Expand Up @@ -704,18 +704,18 @@ <h3>Methods</h3>
</details>
</dd>
<dt id="pwndocapi.API.API.login"><code class="name flex">
<span>def <span class="ident">login</span></span>(<span>self, username, password)</span>
<span>def <span class="ident">login</span></span>(<span>self, username, password, totp=&#34;&#34;)</span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def login(self, username, password):
<pre><code class="python">def login(self, username, password, totp=&#34;&#34;):
r = self.session.post(
self.target + &#34;/api/users/token&#34;,
json={&#34;username&#34;: username, &#34;password&#34;: password, &#34;totpToken&#34;: &#34;&#34;},
json={&#34;username&#34;: username, &#34;password&#34;: password, &#34;totpToken&#34;: totp},
verify=False
)
if r.json()[&#34;status&#34;] == &#34;success&#34;:
Expand All @@ -729,7 +729,7 @@ <h3>Methods</h3>
self.loggedin = True
elif r.json()[&#34;status&#34;] == &#34;error&#34;:
if self.verbose:
print(&#34;[!] Login error. (%s)&#34; % r.json()[&#34;status&#34;])
print(&#34;[!] Login error. (%s)&#34; % r.json()[&#34;datas&#34;])
self.loggedin = False
return self.loggedin</code></pre>
</details>
Expand Down Expand Up @@ -858,4 +858,4 @@ <h4><code><a title="pwndocapi.API.API" href="#pwndocapi.API.API">API</a></code><
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
</footer>
</body>
</html>
</html>

0 comments on commit 726dec4

Please sign in to comment.