mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-17 01:11:38 +03:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e1d19e0a4 | ||
|
|
d6a9bb4c09 | ||
|
|
3c67765992 | ||
|
|
6bb613e0e7 | ||
|
|
7be115f7da | ||
|
|
924bb1468b |
15
CHANGELOG.md
15
CHANGELOG.md
@@ -1,3 +1,18 @@
|
|||||||
|
## [](https://github.com/stonith404/pocket-id/compare/v0.5.2...v) (2024-09-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add space to "Firstname" and "Lastname" label ([#31](https://github.com/stonith404/pocket-id/issues/31)) ([d6a9bb4](https://github.com/stonith404/pocket-id/commit/d6a9bb4c09efb8102da172e49c36c070b341f0fc))
|
||||||
|
* port environment variables get ignored in caddyfile ([3c67765](https://github.com/stonith404/pocket-id/commit/3c67765992d7369a79812bc8cd216c9ba12fd96e))
|
||||||
|
|
||||||
|
## [](https://github.com/stonith404/pocket-id/compare/v0.5.1...v) (2024-09-19)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* updated application name doesn't apply to webauthn credential ([924bb14](https://github.com/stonith404/pocket-id/commit/924bb1468bbd8e42fa6a530ef740be73ce3b3914))
|
||||||
|
|
||||||
## [](https://github.com/stonith404/pocket-id/compare/v0.5.0...v) (2024-09-16)
|
## [](https://github.com/stonith404/pocket-id/compare/v0.5.0...v) (2024-09-16)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
module github.com/stonith404/pocket-id/backend
|
module github.com/stonith404/pocket-id/backend
|
||||||
|
|
||||||
go 1.23
|
go 1.23.1
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/caarlos0/env/v11 v11.2.2
|
github.com/caarlos0/env/v11 v11.2.2
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ type WebAuthnService struct {
|
|||||||
webAuthn *webauthn.WebAuthn
|
webAuthn *webauthn.WebAuthn
|
||||||
jwtService *JwtService
|
jwtService *JwtService
|
||||||
auditLogService *AuditLogService
|
auditLogService *AuditLogService
|
||||||
|
appConfigService *AppConfigService
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewWebAuthnService(db *gorm.DB, jwtService *JwtService, auditLogService *AuditLogService, appConfigService *AppConfigService) *WebAuthnService {
|
func NewWebAuthnService(db *gorm.DB, jwtService *JwtService, auditLogService *AuditLogService, appConfigService *AppConfigService) *WebAuthnService {
|
||||||
@@ -36,12 +37,13 @@ func NewWebAuthnService(db *gorm.DB, jwtService *JwtService, auditLogService *Au
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
wa, _ := webauthn.New(webauthnConfig)
|
wa, _ := webauthn.New(webauthnConfig)
|
||||||
return &WebAuthnService{db: db, webAuthn: wa, jwtService: jwtService, auditLogService: auditLogService}
|
return &WebAuthnService{db: db, webAuthn: wa, jwtService: jwtService, auditLogService: auditLogService, appConfigService: appConfigService}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *WebAuthnService) BeginRegistration(userID string) (*model.PublicKeyCredentialCreationOptions, error) {
|
func (s *WebAuthnService) BeginRegistration(userID string) (*model.PublicKeyCredentialCreationOptions, error) {
|
||||||
|
s.updateWebAuthnConfig()
|
||||||
|
|
||||||
var user model.User
|
var user model.User
|
||||||
if err := s.db.Preload("Credentials").Find(&user, "id = ?", userID).Error; err != nil {
|
if err := s.db.Preload("Credentials").Find(&user, "id = ?", userID).Error; err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -203,3 +205,8 @@ func (s *WebAuthnService) UpdateCredential(userID, credentialID, name string) (m
|
|||||||
|
|
||||||
return credential, nil
|
return credential, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// updateWebAuthnConfig updates the WebAuthn configuration with the app name as it can change during runtime
|
||||||
|
func (s *WebAuthnService) updateWebAuthnConfig() {
|
||||||
|
s.webAuthn.Config.RPDisplayName = s.appConfigService.DbConfig.AppName.Value
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
:80 {
|
:80 {
|
||||||
reverse_proxy /api/* http://localhost:8080
|
reverse_proxy /api/* http://localhost:{$BACKEND_PORT:8080}
|
||||||
reverse_proxy /.well-known/* http://localhost:8080
|
reverse_proxy /.well-known/* http://localhost:{$BACKEND_PORT:8080}
|
||||||
reverse_proxy /* http://localhost:3000
|
reverse_proxy /* http://localhost:{$PORT:3000}
|
||||||
|
|
||||||
log {
|
log {
|
||||||
output file /var/log/caddy/access.log
|
output file /var/log/caddy/access.log
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
:80 {
|
:80 {
|
||||||
reverse_proxy /api/* http://localhost:8080 {
|
reverse_proxy /api/* http://localhost:{$BACKEND_PORT:8080} {
|
||||||
trusted_proxies 0.0.0.0/0
|
trusted_proxies 0.0.0.0/0
|
||||||
}
|
}
|
||||||
reverse_proxy /.well-known/* http://localhost:8080 {
|
reverse_proxy /.well-known/* http://localhost:{$BACKEND_PORT:8080} {
|
||||||
trusted_proxies 0.0.0.0/0
|
trusted_proxies 0.0.0.0/0
|
||||||
}
|
}
|
||||||
reverse_proxy /* http://localhost:3000 {
|
reverse_proxy /* http://localhost:{$PORT:3000} {
|
||||||
trusted_proxies 0.0.0.0/0
|
trusted_proxies 0.0.0.0/0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user