Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d2e4e899d | ||
|
|
48f718191f | ||
|
|
e130bc5c0a |
+1
-13
@@ -1,4 +1,5 @@
|
||||
localhost {
|
||||
# Setup the authentication site at /auth/
|
||||
import auth/setup
|
||||
# Only users with myapp:reports and auth admin permissions
|
||||
handle_path /reports {
|
||||
@@ -22,16 +23,3 @@ localhost {
|
||||
reverse_proxy :3000
|
||||
}
|
||||
}
|
||||
|
||||
example.com {
|
||||
# Public endpoints in handle blocks before auth
|
||||
@public path /favicon.ico /.well-known/*
|
||||
handle @public {
|
||||
root * /var/www/
|
||||
file_server
|
||||
}
|
||||
# The rest of the site protected, /auth/ reserved for auth service
|
||||
import auth/all perm=auth:admin {
|
||||
reverse_proxy :3000
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
# Enable auth site at /auth (setup) and require authentication on all paths
|
||||
import setup
|
||||
handle {
|
||||
import require {args[0]}
|
||||
{block}
|
||||
}
|
||||
+4
-2
@@ -1,5 +1,7 @@
|
||||
# Permission to use within your endpoints that need authentication/authorization, that
|
||||
# is different depending on the route (otherwise use auth/all).
|
||||
# Permission to use within your endpoints that need authentication/authorization
|
||||
# Argument is mandatory and provides a query string to /auth/api/forward
|
||||
# "" means just authentication
|
||||
# perm=yourservice:login to require specific permission
|
||||
forward_auth {$AUTH_UPSTREAM:localhost:4401} {
|
||||
uri /auth/api/forward?{args[0]}
|
||||
header_up Connection keep-alive # Much higher performance
|
||||
|
||||
@@ -130,6 +130,7 @@ export const useAuthStore = defineStore('auth', {
|
||||
async logout() {
|
||||
try {
|
||||
await fetch('/auth/api/logout', {method: 'POST'})
|
||||
sessionStorage.clear()
|
||||
location.reload()
|
||||
} catch (error) {
|
||||
console.error('Logout error:', error)
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "passkey"
|
||||
version = "0.1.1"
|
||||
version = "0.1.2"
|
||||
description = "Passkey Authentication for Web Services"
|
||||
authors = [
|
||||
{name = "Leo Vasanko"},
|
||||
|
||||
Reference in New Issue
Block a user