Hello Appwrite Support,
I'm experiencing an issue with the password reset process. The secret key sent with the redirect URL is 256 characters long, which exceeds the 255-character limit set by Appwrite. When using the account.updateRecovery method, I receive the following error: "AppwriteException: Invalid document structure: Attribute "key" has invalid type. Value must be a valid string and no longer than 255 chars"
Code snippet to handle the password reset: import { useState, useEffect } from "react"; import { account } from "../Backend/appwriteConfig"; // Assumes correct setup const NewPassword = () => { const [form, setForm] = useState({ password: "", confirmpassword: "" }); const [secret, setSecret] = useState(""); useEffect(() => { const queryParams = new URLSearchParams(window.location.search); const secretKey = queryParams.get("secret"); if (secretKey) { setSecret(secretKey); } else { console.error("Invalid password reset link."); } }, []); const updatePassword = async (password, secret) => { try { // Attempting to update the password with a secret key of 256 characters const trimmedSecret = secret.slice(0, 255); // Trimmed version const res = await account.updateRecovery("userId", trimmedSecret, password); // User ID used here for example console.log("Password updated successfully:", res); } catch (error) { console.error("Error updating password:", error); } }; // Form submission logic here... };
Questions:
- Is it safe to trim the secret key to 255 characters, or could this compromise security?
- Is there support for handling secret keys longer than 255 characters, possibly through a premium feature or configuration setting?
- Is this key length issue a known limitation or a bug?
- I am using the latest Appwrite SDK on a free plan. Please advise on how to proceed.
Thank you for your assistance!
Best regards! Gift Jackson codewithjacksun@gmail.com
Recommended threads
- Custom emails
What happen if I use a third party email provider to customize my emails and my plan run out of emails/month? Appwrite emails are used as fallback sending emai...
- Realtime with multiple connections
I need the Realtime on multiple Collections for diffrent applicational logic. So my question is: Is there a way to have only 1 Websocket connection or do I need...
- [SOLVED] React Native Appwrite SDK not w...
So I'm trying to generate a unique ID using the ID.unique() and its generating properly, but its saying its longer than 36 characters but it isnt.. ```typescri...