improvement: QRcode and shared link added to cases inorder to make it possible for staff users to share a case info with other staffs or other clinics.
This commit is contained in:
@@ -17,6 +17,7 @@ import {
|
||||
startProactiveSessionRefresh,
|
||||
} from '@/lib/auth/proactiveRefresh';
|
||||
import { asApiError, legacyStatusCode, type ApiError } from '@/types/api';
|
||||
import { consumeAuthRedirect } from '@/lib/auth/postAuthRedirect';
|
||||
|
||||
function toApiError(err: unknown): ApiError {
|
||||
return (
|
||||
@@ -288,10 +289,8 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
|
||||
await authApi.selectOrganization(org.id);
|
||||
setCurrentOrganization(org);
|
||||
localStorage.setItem('currentOrganizationId', org.id);
|
||||
router.push('/today');
|
||||
} else {
|
||||
router.push('/select-organization');
|
||||
|
||||
}
|
||||
|
||||
} catch (err: any) {
|
||||
@@ -332,7 +331,6 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
|
||||
await authApi.selectOrganization(org.id);
|
||||
setCurrentOrganization(org);
|
||||
localStorage.setItem('currentOrganizationId', org.id);
|
||||
router.push('/today');
|
||||
} else {
|
||||
router.push('/select-organization');
|
||||
}
|
||||
@@ -388,12 +386,8 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
|
||||
plan: (organization as { plan?: Organization['plan'] }).plan,
|
||||
});
|
||||
|
||||
const redirectPath =
|
||||
typeof window !== 'undefined'
|
||||
? sessionStorage.getItem('authRedirect')
|
||||
: null;
|
||||
const redirectPath = consumeAuthRedirect();
|
||||
if (redirectPath) {
|
||||
sessionStorage.removeItem('authRedirect');
|
||||
router.push(redirectPath);
|
||||
} else {
|
||||
router.push('/today');
|
||||
|
||||
Reference in New Issue
Block a user