mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Merge pull request #692 from appwrite/fix-redirection-issue
fix: wrong redirection
This commit is contained in:
@@ -7,7 +7,9 @@ export const load: PageLoad = async ({ parent, url }) => {
|
||||
|
||||
if (organizations.total) {
|
||||
const teamId = account.prefs.organization ?? organizations.teams[0].$id;
|
||||
throw redirect(303, `${base}/console/organization-${teamId}${url.search ?? ''}`);
|
||||
if (!teamId) {
|
||||
throw redirect(303, `${base}/console/account/organizations${url.search ?? ''}`);
|
||||
} else throw redirect(303, `${base}/console/organization-${teamId}${url.search ?? ''}`);
|
||||
} else {
|
||||
throw redirect(303, `${base}/console/onboarding${url.search ?? ''}`);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ export const load: LayoutLoad = async ({ params, depends }) => {
|
||||
};
|
||||
} catch (e) {
|
||||
const prefs = await sdk.forConsole.account.getPrefs();
|
||||
const newPrefs = { ...prefs, organization: '' };
|
||||
const newPrefs = { ...prefs, organization: null };
|
||||
sdk.forConsole.account.updatePrefs(newPrefs);
|
||||
localStorage.removeItem('organization');
|
||||
throw error(e.code, e.message);
|
||||
|
||||
Reference in New Issue
Block a user