I am updating my react app to use EXPO SDK 54 and appwrite-react-native SDK 0.17.x but the account.get() function is not working I use it to get the current user in my login.
here is my login code:
TypeScript
var oldSession = await hasSession()
//console.log("Old session exists:", oldSession)
try {
if (oldSession) {
await account.deleteSession("current")
}
const response = await account.createEmailPasswordSession({ email: email, password: password })
//console.log("Login successful", response)
const currentUser = await account.get()
//console.log("Current user:", currentUser)
setUser(currentUser as User)
await AsyncStorage.setItem("user", JSON.stringify(currentUser))
} catch (error) {
console.error("Error logging in:", error)
throw error
}
}```
I loging with the email and password first but it seems like no session is returned
TL;DR
Issue: Error with account.get() function after updating to EXPO SDK 54 and appwrite-react-native SDK 0.17.x. The current user is not being retrieved in the login process.
Solution: The issue may be due to an outdated syntax or dependencies mismatch. Check for any changes needed in the new SDK versions for the account.get() method.Recommended threads
- Getting CORS error when accessing websit...
When accessing my website I'm getting: (index):1 Access to font at 'https://assets.appwrite.io/fonts/inter/Inter-Regular.woff2' from origin 'https://mvp-site-ra...
- listDocuments is deprecated. What should...
``` const database = new Databases(client); export const updateSearchCount = async (query: string, movie: Movie) => { const result = await database.listDoc...
- Questions about requests count on dashbo...
Hi guys I am new to this platform so I dont know if I am doing anything wrong. On dsahboard the request count is about 50k even though I dont feel like I have d...