-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added locally unprotected route and API routes pages (#11)
- Loading branch information
1 parent
5144f00
commit 5f8e41e
Showing
4 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<script lang="ts"> | ||
export default { | ||
props: { | ||
route: String, | ||
method: String, | ||
link: String, | ||
} | ||
} | ||
</script> | ||
|
||
<template> | ||
<tr class="bg-gray-800 border-gray-700"> | ||
<th scope="row" class="py-4 px-6 font-medium whitespace-nowrap text-white"> | ||
{{ route }} | ||
</th> | ||
<td class="py-4 px-6 uppercase"> | ||
{{ method }} | ||
</td> | ||
<td class="py-4 px-6"> | ||
<nuxt-link :href="link" target="_blank"> | ||
View Route | ||
<i class="fa fa-external-link" /> | ||
</nuxt-link> | ||
</td> | ||
</tr> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<template> | ||
<div class="max-w-5xl mx-auto mt-5 px-5"> | ||
<div class="overflow-x-auto relative rounded"> | ||
<table class="w-full text-sm text-left text-gray-400"> | ||
<thead class="text-xs uppercase bg-gray-700 text-gray-400"> | ||
<tr> | ||
<th scope="col" class="py-3 px-6"> | ||
Route | ||
</th> | ||
<th scope="col" class="py-3 px-6"> | ||
Method | ||
</th> | ||
<th scope="col" class="py-3 px-6"> | ||
Link | ||
</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<APITableRow | ||
route="/session" | ||
method="get" | ||
link="/api/auth/session" | ||
/> | ||
<APITableRow | ||
route="/csrf" | ||
method="get" | ||
link="/api/auth/csrf" | ||
/> | ||
<APITableRow | ||
route="/providers" | ||
method="get" | ||
link="/api/auth/providers" | ||
/> | ||
<APITableRow | ||
route="/signin" | ||
method="get" | ||
link="/api/auth/signin" | ||
/> | ||
<APITableRow | ||
route="/signin/:provider" | ||
method="post" | ||
link="/api/auth/signin/github" | ||
/> | ||
<APITableRow | ||
route="/callback/:provider" | ||
method="get & post" | ||
link="/api/auth/callback/github" | ||
/> | ||
<APITableRow | ||
route="/signout" | ||
method="get & post" | ||
link="/api/auth/signout" | ||
/> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
definePageMeta({ auth: false }) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<template> | ||
<div class="text-center mt-10"> | ||
<h1 class="text-2xl font-bold">I am publicly available!</h1> | ||
<h3>The global protecting is disabled via <a href="https://github.com/sidebase/nuxt-auth#disabling-the-global-middleware-locally" target="_blank">local middleware</a>.</h3> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
definePageMeta({ auth: false }) | ||
</script> | ||
|
||
<style scoped> | ||
a { | ||
@apply text-green-600 underline hover:text-green-500; | ||
} | ||
</style> |