view data fixes
This commit is contained in:
@@ -17,7 +17,7 @@ export class AuthPageService implements Service {
|
||||
async processLoginParams(params: AuthPageParams): Promise<Result<LoginPageDTO, DomainError>> {
|
||||
try {
|
||||
const returnTo = params.returnTo ?? '/dashboard';
|
||||
const hasInsufficientPermissions = params.returnTo !== null;
|
||||
const hasInsufficientPermissions = params.returnTo !== undefined && params.returnTo !== null;
|
||||
|
||||
return Result.ok({
|
||||
returnTo,
|
||||
|
||||
@@ -28,7 +28,7 @@ export class SessionService implements Service {
|
||||
if (res.isErr()) return Result.err(res.getError());
|
||||
|
||||
const data = res.unwrap();
|
||||
if (!data || !data.user) return Result.ok(null);
|
||||
if (!data || !data.user || Object.keys(data.user).length === 0) return Result.ok(null);
|
||||
return Result.ok(new SessionViewModel(data.user));
|
||||
} catch (error: unknown) {
|
||||
return Result.err({ type: 'serverError', message: (error as Error).message || 'Failed to get session' });
|
||||
|
||||
Reference in New Issue
Block a user