
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
- Flutter OAuth2 Google Login – Redirect I...
i tried implementing OAuth2 Google Login in my app, and it works fine for the most part, the problem am facing is when i chose a google account to sign in/up wi...
- cant add attributes
i have 20 attributes in the table, and when i try to add 1 more, i get error: "The maximum number or size of columns for this table has been reached", is 20 att...
- 500 Server Error
I m getting the above error for a particular table in the databases.
