Skip to content

Commit

Permalink
fix dynamic user name
Browse files Browse the repository at this point in the history
  • Loading branch information
bryantgillespie committed Jan 7, 2024
1 parent 45bde32 commit 484894c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion layers/portal/pages/portal/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ function useGreetings() {
}
const { getTodaysMessage } = useGreetings();
const { user } = useDirectusAuth();
</script>
<template>
<PageContainer>
<img class="w-48 ml-auto mr-0" src="~/assets/illustrations/tokyo-luminous-table-lamp-on-boxes.svg" />
<TypographyTitle class="normal-case">{{ greetUser() }} Bryant,</TypographyTitle>
<TypographyTitle class="normal-case">{{ greetUser() }} {{ user?.first_name ?? 'friend' }},</TypographyTitle>
<TypographyHeadline :content="getTodaysMessage()" size="xl" />
<VDivider class="my-8" />
<div class="grid w-full grid-cols-1 gap-6 md:grid-cols-2">
Expand Down
3 changes: 2 additions & 1 deletion modules/directus/runtime/composables/useDirectusAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import jwtDecode from 'jwt-decode';
import { readMe, passwordRequest, passwordReset } from '@directus/sdk';
import type { RestClient, AuthenticationClient } from '@directus/sdk';
import type { Schema } from '~/types/schema';
import type { User } from '~/types'

import { useState, useRuntimeConfig, useRoute, navigateTo, clearNuxtData, useNuxtApp } from '#imports';

export default function useDirectusAuth<DirectusSchema extends object>() {
const nuxtApp = useNuxtApp();
const $directus = nuxtApp.$directus as RestClient<Schema> & AuthenticationClient<Schema>;

const user = useState('user');
const user: Ref<User> = useState('user');

const config = useRuntimeConfig();

Expand Down

0 comments on commit 484894c

Please sign in to comment.