mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-07 12:29:50 +08:00
feat: add captcha support for sign in/up (#4582)
This commit is contained in:
@@ -7,6 +7,7 @@ edition = "2021"
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[dependencies]
|
||||
chrono = "0.4"
|
||||
jwst-codec = { git = "https://github.com/toeverything/OctoBase.git", rev = "ad51b2c" }
|
||||
jwst-core = { git = "https://github.com/toeverything/OctoBase.git", rev = "ad51b2c" }
|
||||
jwst-storage = { git = "https://github.com/toeverything/OctoBase.git", rev = "ad51b2c" }
|
||||
@@ -15,6 +16,11 @@ napi = { version = "2", default-features = false, features = [
|
||||
"async",
|
||||
] }
|
||||
napi-derive = { version = "2", features = ["type-def"] }
|
||||
rand = "0.8"
|
||||
sha3 = "0.10"
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = "1"
|
||||
|
||||
[build-dependencies]
|
||||
napi-build = "2"
|
||||
|
||||
Vendored
+9
@@ -3,6 +3,15 @@
|
||||
|
||||
/* auto-generated by NAPI-RS */
|
||||
|
||||
export function verifyChallengeResponse(
|
||||
response: string,
|
||||
bits: number,
|
||||
resource: string
|
||||
): Promise<boolean>;
|
||||
export function mintChallengeResponse(
|
||||
resource: string,
|
||||
bits?: number | undefined | null
|
||||
): Promise<string>;
|
||||
export interface Blob {
|
||||
contentType: string;
|
||||
lastModified: string;
|
||||
|
||||
@@ -7,3 +7,5 @@ const binding = require('./storage.node');
|
||||
|
||||
export const Storage = binding.Storage;
|
||||
export const mergeUpdatesInApplyWay = binding.mergeUpdatesInApplyWay;
|
||||
export const verifyChallengeResponse = binding.verifyChallengeResponse;
|
||||
export const mintChallengeResponse = binding.mintChallengeResponse;
|
||||
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
../../native/src/hashcash.rs
|
||||
@@ -1,5 +1,7 @@
|
||||
#![deny(clippy::all)]
|
||||
|
||||
pub mod hashcash;
|
||||
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
fmt::{Debug, Display},
|
||||
|
||||
Reference in New Issue
Block a user