Open siwamsingh opened 8 months ago
Congratulations, @siwamsingh! 🎉 Thank you for creating your issue. Your contribution is greatly appreciated and I look forward to work with you to resolve the issue. Keep up the great work!
I will promptly review your changes and offer feedback. Keep up the excellent work! Kindly remember to check my contributing guidelines
I want to work on this @dakshsinghrathore
Assigned this issue to @iMADi-ARCH , kindly drop a star on this repo HAPPY CODING !
I am trying to use the cdn version of appwrite -
<script src="https://cdn.jsdelivr.net/npm/appwrite@13.0.1"></script>
But it doesn't seem to work. I keep getting -
Uncaught ReferenceError: Client is not defined
at index.html:550:20
// inside script tag of index.html file -
class AuthService {
constructor() {
this.client = new Client();
this.client
.setEndpoint("https://cloud.appwrite.io/v1")
.setProject("659ed1cb2241fa3a86d3");
this.account = new Account(client);
this.user = null;
this.init();
}
async init() {
this.user = await this.account.get();
}
async login(email, password) {
await this.account.createEmailSession(email, password);
}
}
// Authentication
const authService = new AuthService();
console.log(authService);
document.getElementById("login").addEventListener("click", async (e) => {
await authService.login("email@email.com", "password");
window.location.href = "getstarted.html";
console.log(authService.user);
});
Instead of
this.client = new Client();
this.client
.setEndpoint("https://cloud.appwrite.io/v1")
.setProject("659ed1cb2241fa3a86d3");
Use this
this.client = new Client().setEndpoint("https://cloud.appwrite.io/v1")
.setProject("659ed1cb2241fa3a86d3");
Instead of importing the class making object everytime at different locations, make object once in its file and import that single object everywhere .
@iMADi-ARCH what's the update??
Is there an existing issue for this?
What happened?
Create a new branch named 'auth' in the repository.
Remove the Firebase authentication from the current login button functionality.
Implement Appwrite for handling login and registration. Develop an
authService
class containing methods for login and registration.Feel free to reach out for any clarifications on these tasks.
Introduce an alert box that pops up when the "Get Started" button is clicked, notifying the user to log in if they are not currently authenticated.
Discord -id : siwam_singh
Record