mirror of
https://github.com/LukeHagar/website.git
synced 2025-12-09 12:57:48 +00:00
Search replace createEmailSession to createEmailPasswordSession
This commit is contained in:
@@ -34,7 +34,7 @@ class AccountService(client: Client) {
|
||||
|
||||
suspend fun login(email: String, password: String): User<Map<String, Any>>? {
|
||||
return try {
|
||||
account.createEmailSession(email, password)
|
||||
account.createEmailPasswordSession(email, password)
|
||||
getLoggedIn()
|
||||
} catch (e: AppwriteException) {
|
||||
null
|
||||
|
||||
@@ -39,7 +39,7 @@ export const useUserSession = () => {
|
||||
};
|
||||
|
||||
const login = async (email: string, password: string): Promise<void> => {
|
||||
const authUser = await account.createEmailSession(email, password); // Open user session in Appwrite
|
||||
const authUser = await account.createEmailPasswordSession(email, password); // Open user session in Appwrite
|
||||
current.value = authUser; // Pass user data to current ref
|
||||
navigateTo("/");
|
||||
};
|
||||
|
||||
@@ -29,7 +29,7 @@ export function UserProvider(props) {
|
||||
const [user, setUser] = useState(null);
|
||||
|
||||
async function login(email, password) {
|
||||
const loggedIn = await account.createEmailSession(email, password);
|
||||
const loggedIn = await account.createEmailPasswordSession(email, password);
|
||||
setUser(loggedIn);
|
||||
toast('Welcome back. You are logged in');
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ export function UserProvider(props) {
|
||||
const [user, setUser] = useState(null);
|
||||
|
||||
async function login(email, password) {
|
||||
const loggedIn = await account.createEmailSession(email, password);
|
||||
const loggedIn = await account.createEmailPasswordSession(email, password);
|
||||
setUser(loggedIn);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ Now we just need to create a form to let the user input sign in data.
|
||||
}
|
||||
|
||||
try {
|
||||
await appwrite.account.createEmailSession(email, password);
|
||||
await appwrite.account.createEmailPasswordSession(email, password);
|
||||
await invalidateAll();
|
||||
} catch (e) {
|
||||
formError = /** @type {import('appwrite').AppwriteException} */ (e).message;
|
||||
|
||||
@@ -37,7 +37,7 @@ For signup, you can copy the login `+page.js` and `+page.svelte` files into `src
|
||||
|
||||
try {
|
||||
await appwrite.account.create(ID.unique(), email, password, name);
|
||||
await appwrite.account.createEmailSession(email, password);
|
||||
await appwrite.account.createEmailPasswordSession(email, password);
|
||||
await invalidateAll();
|
||||
} catch (e) {
|
||||
formError = /** @type {import('appwrite').AppwriteException} */ (e).message;
|
||||
|
||||
@@ -43,7 +43,7 @@ const createUser = () => {
|
||||
|
||||
async function login(email, password) {
|
||||
if (!isBrowser) return;
|
||||
await account.createEmailSession(email, password);
|
||||
await account.createEmailPasswordSession(email, password);
|
||||
await init();
|
||||
goto('/'); // Redirect to home page after login
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ export const user = reactive({
|
||||
await this.login(email, password);
|
||||
},
|
||||
async login(email, password) {
|
||||
await account.createEmailSession(email, password);
|
||||
await account.createEmailPasswordSession(email, password);
|
||||
window.location.href = "/"; // Redirect to home page
|
||||
},
|
||||
async logout() {
|
||||
|
||||
Reference in New Issue
Block a user