Skip to content

Instantly share code, notes, and snippets.

@OnnoGabriel
OnnoGabriel / login-attempt-limiter.js
Last active April 30, 2021 06:13
Login Attempt Limiter for Feathers
/**
* Login Attempt Limiter Hook for Feathers (https://feathersjs.com/)
*
* Limits the login attempts by recording the number of failed logins
* and the datetime of the last login attempt to the user data.
*
* 1. Extend your user model by two fields:
* loginAttempts: {
* type: DataTypes.INTEGER,
* defaultValue: 0
@OnnoGabriel
OnnoGabriel / create_certificates.sh
Last active October 31, 2020 20:17
Create self-signed CA certificates and certificates for local domains
#!/bin/bash
# Creates self-signed CA certificates and certificates for local domains.
#
# Prompts for a local domain name (e.g. my-app.localhost) and creates all
# necessary certificates.
#
# Next steps:
# Copy the certificates (e.g. my-app.localhost.crt and my-app.localhost.key) to
# your service (Nginx, Apache, ...) and configure it.