wen i am trying to wrap the services on a provider it showing error why ???
import { Client, Databases, Account,ID} from "appwrite";
import conf from "../conf/conf";
export class Services{
client = new Client()
account
databases
constructor(){
this.client.setEndpoint(conf.Appwrite_url)
.setProject(conf.APPWRITE_PROJECT_ID)
this.account=new Account(this.client)
this.databases=new Account(this.client)
}
async register(email, password){
try {
await this.account.create(email,password)
await this.login(email,password)
} catch (error) {
console.log('there is some error in login')
return false
}
}
async login(email,password){
try {
await this.account.createEmailSession(email,password)
} catch (error) {
console.log('there is some error in login')
return false
}
}
async logout(){
try {
await this.account.deleteSessions('current')
} catch (error) {
console.log('there is some error in logout')
}
}
}
const services=new Services()
export default services here is my service file
FYI, it's best to wrap code in backticks to format a bit nicer. You can use 1 backtick for inline code (https://www.markdownguide.org/basic-syntax/#code) and 3 backticks for multiline code (https://www.markdownguide.org/extended-syntax/#syntax-highlighting.
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...
- SyntaxError: Unexpected end of JSON inpu...
I am trying to create a fcm push notification service using appwrite functions with its REST API to invoke that function from my client side app and getting thi...
- Experiencing inconsistent "500 general_u...
I am developing a task management app that uses Appwrite auth. My project is hosted on Appwrite cloud and I've created basic server-side authentication followin...