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