mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Merge branch 'feat-billing' of github.com:appwrite/console into feat-billing
This commit is contained in:
@@ -4,13 +4,10 @@ const SECRET = env.PUBLIC_CONSOLE_FINGERPRINT_KEY ?? '';
|
||||
const CACHE_TTL_MS = 60 * 60 * 1000; // 1 hour
|
||||
|
||||
async function sha256(message: string): Promise<string> {
|
||||
if (!crypto?.subtle) return '';
|
||||
const data = new TextEncoder().encode(message);
|
||||
const hash = await crypto.subtle.digest('SHA-256', data);
|
||||
return Array.from(new Uint8Array(hash))
|
||||
.map((b) => b.toString(16).padStart(2, '0'))
|
||||
.join('');
|
||||
}
|
||||
if (!crypto?.subtle) {
|
||||
console.warn('crypto.subtle unavailable, fingerprinting disabled');
|
||||
return '';
|
||||
}
|
||||
|
||||
async function hmacSha256(message: string, secret: string): Promise<string> {
|
||||
if (!crypto?.subtle) return '';
|
||||
|
||||
@@ -110,7 +110,7 @@ export const load: LayoutLoad = async ({ params, depends, parent }) => {
|
||||
generateFingerprintToken()
|
||||
.then((fingerprint) => {
|
||||
sdk.forConsole.client.headers['X-Appwrite-Console-Fingerprint'] = fingerprint;
|
||||
sdk.forConsole.projects.updateConsoleAccess({
|
||||
return sdk.forConsole.projects.updateConsoleAccess({
|
||||
projectId: params.project
|
||||
});
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user