Fix Studio Pillar crash and fetch user profile on login
Some checks failed
Velocity-OS Deployment Pipeline / lint (push) Has been cancelled
Velocity-OS Deployment Pipeline / build-and-push (agents) (push) Has been cancelled
Velocity-OS Deployment Pipeline / build-and-push (core) (push) Has been cancelled
Velocity-OS Deployment Pipeline / build-and-push (media-engine) (push) Has been cancelled
Velocity-OS Deployment Pipeline / build-and-push (webos) (push) Has been cancelled
Velocity-OS Deployment Pipeline / sign-images (agents) (push) Has been cancelled
Velocity-OS Deployment Pipeline / sign-images (core) (push) Has been cancelled
Velocity-OS Deployment Pipeline / sign-images (media-engine) (push) Has been cancelled
Velocity-OS Deployment Pipeline / sign-images (webos) (push) Has been cancelled
Velocity-OS Deployment Pipeline / notify-ingress (push) Has been cancelled
Some checks failed
Velocity-OS Deployment Pipeline / lint (push) Has been cancelled
Velocity-OS Deployment Pipeline / build-and-push (agents) (push) Has been cancelled
Velocity-OS Deployment Pipeline / build-and-push (core) (push) Has been cancelled
Velocity-OS Deployment Pipeline / build-and-push (media-engine) (push) Has been cancelled
Velocity-OS Deployment Pipeline / build-and-push (webos) (push) Has been cancelled
Velocity-OS Deployment Pipeline / sign-images (agents) (push) Has been cancelled
Velocity-OS Deployment Pipeline / sign-images (core) (push) Has been cancelled
Velocity-OS Deployment Pipeline / sign-images (media-engine) (push) Has been cancelled
Velocity-OS Deployment Pipeline / sign-images (webos) (push) Has been cancelled
Velocity-OS Deployment Pipeline / notify-ingress (push) Has been cancelled
This commit is contained in:
@@ -148,7 +148,7 @@ export default function PropertyEntity() {
|
||||
)}
|
||||
{property.amenities && (
|
||||
<div className={styles.amenities}>
|
||||
{property.amenities.map((a, i) => (
|
||||
{(property.amenities || []).map((a, i) => (
|
||||
<span key={i} className={`${styles.amenityChip} glass`}>{a}</span>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -54,7 +54,7 @@ function PropertiesSection() {
|
||||
|
||||
return (
|
||||
<div className={styles.propGrid}>
|
||||
{properties.map((prop, i) => (
|
||||
{(properties || []).map((prop, i) => (
|
||||
<motion.button
|
||||
key={prop.id}
|
||||
className={`${styles.propCard} glass-card`}
|
||||
|
||||
@@ -25,10 +25,23 @@ export function LoginPage() {
|
||||
setError('');
|
||||
|
||||
try {
|
||||
const { access_token, user } = await api.post<{ access_token: string; user: any }>(
|
||||
const { access_token } = await api.post<{ access_token: string }>(
|
||||
'/auth/login',
|
||||
{ email, password }
|
||||
);
|
||||
|
||||
const userProfile = await fetch('/api/auth/me', {
|
||||
headers: { Authorization: `Bearer ${access_token}` }
|
||||
}).then(r => r.json());
|
||||
|
||||
const user = {
|
||||
id: userProfile.user_id,
|
||||
name: userProfile.full_name,
|
||||
email: userProfile.email,
|
||||
role: userProfile.role,
|
||||
avatarUrl: userProfile.avatar_url
|
||||
};
|
||||
|
||||
setSession(user, access_token);
|
||||
navigate('/command', { replace: true });
|
||||
} catch (err: any) {
|
||||
|
||||
Reference in New Issue
Block a user