Deny User Access to Application if User is on IPV6
Last Updated:
Overview
This article will address how to disable/ filter IPV6 from IPV4. By default it is not possible to disable only with a custom Action.
Applies To
- Custom Action
- IPV6
Solution
const ipChecker = require('ip')
exports.onExecutePostLogin = async (event, api) => {
const ip = event.request.ip;
ipChecker.isV4Format(ip) ? console.log('V4')
: api.access.deny(`Access to ${event.user.name} not allowed`)
//Custom logic
};