mirror of
https://github.com/getAlby/lndhub.go.git
synced 2025-12-21 06:34:58 +01:00
Soft delete users (#476)
* Update Makefile * Optionally load test DB from env variable * Add option to soft-delete a user This allows users to be marked as deleted. An additional middleware checks if a user is deleted or deactivated and rejects requests for those as StatusUnauthorized. note: the middelware adds an additional DB query to load the user.
This commit is contained in:
@@ -47,7 +47,10 @@ const (
|
||||
)
|
||||
|
||||
func LndHubTestServiceInit(lndClientMock lnd.LightningClientWrapper) (svc *service.LndhubService, err error) {
|
||||
dbUri := "postgresql://user:password@localhost/lndhub?sslmode=disable"
|
||||
dbUri, ok := os.LookupEnv("DATABASE_URI")
|
||||
if !ok {
|
||||
dbUri = "postgresql://user:password@localhost/lndhub?sslmode=disable"
|
||||
}
|
||||
c := &service.Config{
|
||||
DatabaseUri: dbUri,
|
||||
DatabaseMaxConns: 1,
|
||||
|
||||
Reference in New Issue
Block a user