summaryrefslogtreecommitdiff
path: root/src/components/ResultsBody.astro
blob: 03914dbbcbd6fc16319cd862ebf94fb0b4324fe2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
---
import CountdownTimer from "./CountdownTimer.astro";


// Can be used in other pages to check if the user is logged in or not

const user = Astro.locals.user;

if(!user) {
  // If the user is not logged in, it will redirect to the login page
  Astro.redirect('/login');
}
else{
  // If the user is logged in, it will redirect to the admin page
  Astro.redirect('/admin');
}

---

<div class="resultsContainer ">
    <div class="pre min-h-screen flex flex-col items-center justify-center">
        <CountdownTimer />
        <h1 class="mb-10">Results will be announced soon</h1>
        <a href = "/login" type="submit" class="w-40 bg-purple-600 no-underline text-center text-white py-2 rounded-lg hover:bg-purple-700 focus:outline-none focus:ring-2 focus:ring-purple-600" id="Adminbtn">Admin Login<a/>
    </div>

</div>