mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 05:06:55 +00:00
throw custom error when context could not be read
This commit is contained in:
@@ -135,7 +135,6 @@ export async function getMostRecentCookieWithLoginname(
|
||||
|
||||
if (stringifiedCookie?.value) {
|
||||
const sessions: SessionCookie[] = JSON.parse(stringifiedCookie?.value);
|
||||
|
||||
const filtered = sessions.filter((cookie) => {
|
||||
return !!loginName ? cookie.loginName === loginName : true;
|
||||
});
|
||||
@@ -153,10 +152,10 @@ export async function getMostRecentCookieWithLoginname(
|
||||
if (latest) {
|
||||
return latest;
|
||||
} else {
|
||||
return Promise.reject();
|
||||
return Promise.reject("Could not get the context or retrieve a session");
|
||||
}
|
||||
} else {
|
||||
return Promise.reject();
|
||||
return Promise.reject("Could not read session cookie");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user