
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
- Error getting session: AppwriteException...
I get this error `Error getting session: AppwriteException: User (role: guests) missing scope (account)` when running in prod. As soon as I try running my app o...
- PR Review and Issue Assign?
I am not familiar with how things work here. I know that Issue have to be assigned before solving problem, It is for not wasting contributors time but I like t...
- OTP Session template not working and is ...
Okay so it has been a long while with the issue with OTP Session template, and currently I tried self-hosting and found out that it is linked with Verification ...
