added public route for demonstration
This commit is contained in:
@@ -17,6 +17,10 @@ app.use(express.json())
|
|||||||
app.use(cors())
|
app.use(cors())
|
||||||
app.use(clerkMiddleware())
|
app.use(clerkMiddleware())
|
||||||
|
|
||||||
|
app.get('/public', (_, res) => {
|
||||||
|
res.send('public route accessed');
|
||||||
|
});
|
||||||
|
|
||||||
app.get('/identify-yourself', requireAuth(), (req, res) => {
|
app.get('/identify-yourself', requireAuth(), (req, res) => {
|
||||||
const auth = getAuth(req)
|
const auth = getAuth(req)
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useGet } from "~/composables/useGet";
|
import { useGet } from "~/composables/useGet";
|
||||||
|
|
||||||
|
const publicResult = await useGet('/public')
|
||||||
const identifiedResult = await useGet('/identify-yourself')
|
const identifiedResult = await useGet('/identify-yourself')
|
||||||
const allowedResult = await useGet('/do-you-have-permission')
|
const allowedResult = await useGet('/do-you-have-permission')
|
||||||
const thingsResult = await useGet('/things')
|
const thingsResult = await useGet('/things')
|
||||||
@@ -18,6 +19,9 @@ console.log('something')
|
|||||||
</SignedOut>
|
</SignedOut>
|
||||||
</header>
|
</header>
|
||||||
<main>
|
<main>
|
||||||
|
<div>
|
||||||
|
public: {{ publicResult.data }}
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
identified: {{ identifiedResult.data }}
|
identified: {{ identifiedResult.data }}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user