
I was using Appwrite trying to create a login component in Framer but I am getting an error when I use the createEmailPasswordSession method. The same code works on my Next JS application on localhost but when I try calling this method from the framer component it gives me this error:
Here's my code: import { useState } from "react" import { Client, Account } from "appwrite"
/**
- These annotations control how your component sizes
- Learn more: https://www.framer.com/developers/components/auto-sizing
- @framerSupportedLayoutWidth auto
- @framerSupportedLayoutHeight auto */
export default function Auth(props) { const [email, setEmail] = useState("krutik@framer.com") const [password, setPassword] = useState("<PASSWORD>")
const client = new Client().setProject("66be39a70024858da9ff")
const account = new Account(client)
async function handleSubmit() {
if (email === "" || password === "") {
return
}
try {
const result = await account.createEmailPasswordSession(
email,
password
)
console.log(`success: `, result)
} catch (e) {
console.log(`fail: `, e)
}
}
return (
<div style={{ display: "flex", flexDirection: "column", gap: 12 }}>
<input
style={inputStyle}
type="email"
placeholder="krutik@framer.com"
value={email}
onChange={(e) => setEmail(e.target.value)}
/>
<input
style={inputStyle}
type="password"
placeholder="password"
value={password}
onChange={(e) => setPassword(e.target.value)}
/>
<button onClick={handleSubmit} style={buttonStyle}>
Login
</button>
</div>
)
}
Recommended threads
- 25 document limit
Unable to bypass the 25 document limit: https://github.com/Mooshieblob1/GenerateImagesPreview
- cant get custom domain to work with appw...
Hi, how do I get a custom domain to work? I have set database.vrtuhub.com on the appwrite console as a custom domain and did the cname record for it bit i still...
- [SOLVED] Consfusing Pricing
Why the pricing is showing me to 30 dollar while the original pricing which is 15 dollar per month,it is also including the add ons pricing,which i donot know w...
