Skip to content

Commit cc03e60

Browse files
committed
VPR-151 feat(auth): Dynamic login screen
- Replace direct /login redirect with /welcome landing page across Razor and Vue (cookie LoginPath, profile button, session timeout, generic error, RequireLogin composable) - Validate ReturnUrl with Url.IsLocalUrl on Login/TwoFactor to close open-redirect paths - Refresh SVM branding: shared _ViperBrand lockup (rod mark + stacked school name) replaces UCDSVMLogo on the welcome page and main layout; self-host Proxima Nova (woff2) in place of Google Fonts Roboto - Add AVIF hero/brand images with JPEG/PNG fallback and recompress the login photos (~60% smaller); preload the AVIF hero with a type hint - Serve /fonts with a year-long immutable Cache-Control header - Add Dev/Test environment badges to the layout toolbar and a members sign-in banner to the CAHFS auth page - Drop the dead v-show="false" loading-placeholder markup duplicated in both Vue layouts (the real skeleton lives in the Razor shells)
1 parent ed1f48b commit cc03e60

47 files changed

Lines changed: 1407 additions & 105 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

VueApp/src/CAHFS/pages/CAHFSAuth.vue

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
11
<template>
2-
<ContentBlock content-block-name="cahfs-login"></ContentBlock>
2+
<div>
3+
<ContentBlock content-block-name="cahfs-login"></ContentBlock>
4+
5+
<q-card
6+
flat
7+
bordered
8+
class="bg-ucdavis-blue-10 q-mt-md"
9+
>
10+
<q-card-section class="row items-center no-wrap">
11+
<q-icon
12+
name="login"
13+
color="primary"
14+
size="sm"
15+
class="q-mr-md"
16+
/>
17+
<div>
18+
<h2 class="text-subtitle1 text-weight-bold text-primary q-mt-none q-mb-xs">Members sign-in</h2>
19+
<div class="text-body2">
20+
Sign in with your UC Davis account to open web reports and section pages.
21+
</div>
22+
</div>
23+
</q-card-section>
24+
<q-card-actions class="q-px-md q-pb-md">
25+
<q-btn
26+
:href="loginHref"
27+
type="a"
28+
color="primary"
29+
no-caps
30+
label="Sign in"
31+
/>
32+
</q-card-actions>
33+
</q-card>
34+
</div>
335
</template>
436

537
<script setup lang="ts">
@@ -8,12 +40,14 @@ import { inject, onMounted } from "vue"
840
import { useRouter } from "vue-router"
941
import { useFetch } from "@/composables/ViperFetch"
1042
import { useUserStore } from "@/store/UserStore"
43+
import { getLoginUrl } from "@/composables/RequireLogin"
1144
import ContentBlock from "@/CMS/components/ContentBlock.vue"
1245
1346
const router = useRouter()
1447
const baseUrl = inject<string>("apiURL")
1548
const userStore = useUserStore()
1649
const $q = useQuasar()
50+
const loginHref = getLoginUrl()
1751
1852
async function checkAuth() {
1953
$q.loading.show({

VueApp/src/CTS/pages/CtsHome.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ async function initPage() {
5050
const r = await get(baseUrl + "loggedInUser")
5151
if (!r.success || !r.result.userId) {
5252
window.location.href =
53-
import.meta.env.VITE_VIPER_HOME + "login?ReturnUrl=" + import.meta.env.VITE_VIPER_HOME + "CTS/"
53+
import.meta.env.VITE_VIPER_HOME +
54+
"welcome?ReturnUrl=" +
55+
encodeURIComponent(import.meta.env.VITE_VIPER_HOME + "CTS/" + window.location.search)
5456
} else {
5557
userStore.loadUser(r.result)
5658
}

VueApp/src/assets/UCDSVMLogo.png

-28.7 KB
Binary file not shown.
13.7 KB
Binary file not shown.
13.6 KB
Binary file not shown.
13.8 KB
Binary file not shown.
13.7 KB
Binary file not shown.
8.2 KB
Binary file not shown.
14.7 KB
Loading
2.81 KB
Binary file not shown.

0 commit comments

Comments
 (0)