mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-12 10:35:39 +00:00
Deploying to gh-pages from @ a5558e4b6f 🚀
This commit is contained in:
@@ -208,21 +208,21 @@
|
||||
<span id="206">206</span>
|
||||
</pre><pre class="rust">
|
||||
<span class="comment">/*
|
||||
* Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/</span>
|
||||
* Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/</span>
|
||||
<span class="kw">use</span> <span class="ident">actix_identity::Identity</span>;
|
||||
<span class="kw">use</span> <span class="ident">actix_web</span>::{<span class="ident">web</span>, <span class="ident">HttpResponse</span>, <span class="ident">Responder</span>};
|
||||
<span class="kw">use</span> <span class="ident">argon2_creds::Config</span>;
|
||||
@@ -375,7 +375,7 @@
|
||||
|
||||
<span class="ident">bad_post_req_test</span>(
|
||||
<span class="ident">NAME</span>,
|
||||
<span class="kw-2">&</span><span class="ident">new_password</span>,
|
||||
<span class="ident">new_password</span>,
|
||||
<span class="ident">ROUTES</span>.<span class="ident">account</span>.<span class="ident">update_password</span>,
|
||||
<span class="kw-2">&</span><span class="ident">update_password</span>,
|
||||
<span class="ident">ServiceError::PasswordsDontMatch</span>,
|
||||
@@ -390,7 +390,7 @@
|
||||
|
||||
<span class="ident">bad_post_req_test</span>(
|
||||
<span class="ident">NAME</span>,
|
||||
<span class="kw-2">&</span><span class="ident">new_password</span>,
|
||||
<span class="ident">new_password</span>,
|
||||
<span class="ident">ROUTES</span>.<span class="ident">account</span>.<span class="ident">update_password</span>,
|
||||
<span class="kw-2">&</span><span class="ident">update_password</span>,
|
||||
<span class="ident">ServiceError::WrongPassword</span>,
|
||||
|
||||
@@ -314,7 +314,7 @@
|
||||
<span class="kw">use</span> <span class="ident">sqlx::Error::RowNotFound</span>;
|
||||
|
||||
<span class="kw">let</span> <span class="ident">verify</span> <span class="op">=</span> <span class="op">|</span><span class="ident">stored</span>: <span class="kw-2">&</span><span class="ident">str</span>, <span class="ident">received</span>: <span class="kw-2">&</span><span class="ident">str</span><span class="op">|</span> {
|
||||
<span class="kw">if</span> <span class="ident">Config::verify</span>(<span class="kw-2">&</span><span class="ident">stored</span>, <span class="kw-2">&</span><span class="ident">received</span>)<span class="question-mark">?</span> {
|
||||
<span class="kw">if</span> <span class="ident">Config::verify</span>(<span class="ident">stored</span>, <span class="ident">received</span>)<span class="question-mark">?</span> {
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
} <span class="kw">else</span> {
|
||||
<span class="prelude-val">Err</span>(<span class="ident">ServiceError::WrongPassword</span>)
|
||||
@@ -380,7 +380,7 @@
|
||||
<span class="kw">let</span> <span class="ident">hash</span> <span class="op">=</span> <span class="ident">data</span>.<span class="ident">creds</span>.<span class="ident">password</span>(<span class="kw-2">&</span><span class="ident">payload</span>.<span class="ident">password</span>)<span class="question-mark">?</span>;
|
||||
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">email</span>) <span class="op">=</span> <span class="kw-2">&</span><span class="ident">payload</span>.<span class="ident">email</span> {
|
||||
<span class="ident">data</span>.<span class="ident">creds</span>.<span class="ident">email</span>(<span class="kw-2">&</span><span class="ident">email</span>)<span class="question-mark">?</span>;
|
||||
<span class="ident">data</span>.<span class="ident">creds</span>.<span class="ident">email</span>(<span class="ident">email</span>)<span class="question-mark">?</span>;
|
||||
}
|
||||
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">secret</span>;
|
||||
|
||||
@@ -652,7 +652,7 @@
|
||||
|
||||
<span class="kw">let</span> <span class="ident">add_token_resp</span> <span class="op">=</span> <span class="ident">test::call_service</span>(
|
||||
<span class="kw-2">&</span><span class="ident">app</span>,
|
||||
<span class="macro">post_request!</span>(<span class="kw-2">&</span><span class="ident">update_level</span>, <span class="kw-2">&</span><span class="ident">ROUTES</span>.<span class="ident">levels</span>.<span class="ident">update</span>)
|
||||
<span class="macro">post_request!</span>(<span class="kw-2">&</span><span class="ident">update_level</span>, <span class="ident">ROUTES</span>.<span class="ident">levels</span>.<span class="ident">update</span>)
|
||||
.<span class="ident">cookie</span>(<span class="ident">cookies</span>.<span class="ident">clone</span>())
|
||||
.<span class="ident">to_request</span>(),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user