v0.1.14 - b2b portal
This commit is contained in:
@@ -63,9 +63,16 @@
|
||||
|
||||
try {
|
||||
// Authenticates against the internal Hunter Stock Feeds role/permission
|
||||
// system. The response is shape-compatible with the legacy client
|
||||
// session, so the rest of the app continues to work unchanged.
|
||||
const session = await api.internalLogin(email, password);
|
||||
// system first. If that fails (e.g. a B2B ordering-portal customer, who
|
||||
// lives in the ClientUser table and signs in with the shared client
|
||||
// password), fall back to the client login. Both responses are
|
||||
// shape-compatible with the client session.
|
||||
let session;
|
||||
try {
|
||||
session = await api.internalLogin(email, password);
|
||||
} catch {
|
||||
session = await api.clientLogin(email, password);
|
||||
}
|
||||
const targetHref = getWorkspaceHomeHref(session);
|
||||
postLoginRedirecting = targetHref !== '/';
|
||||
clientSession.set(session);
|
||||
|
||||
Reference in New Issue
Block a user