https://github.com/scrachstack/auth-system
https://github.com/scrachstack/auth-system
auth ejs express javascript website
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/scrachstack/auth-system
- Owner: ScrachStack
- License: mit
- Created: 2025-02-19T00:12:53.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-02-19T01:22:16.000Z (12 months ago)
- Last Synced: 2025-02-19T01:27:27.491Z (12 months ago)
- Topics: auth, ejs, express, javascript, website
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Auth System - Express.js Application
[](https://discord.gg/tgrU8wgeHx)
[](https://ko-fi.com/T6T01APGOO)


## Examples
```
Lua
PerformHttpRequest("http://127.0.0.1/validate-ip", function(result, data)
if (data:gsub("%\"", "") == "SUCCESS_200_OK ") then
print("^2License Activated!")
else
print("^1License Deactivated ^0")
end
end)
PHP
$url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/x-www-form-urlencoded'
]];
$ch = curl_init();
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
curl_close($ch);
if (trim($response) === 'SUCCESS_200_OK') {
echo "License Activated!";
} else {
echo "License Deactivated!";
}
?>
Javascript
const url = "http://127.0.0.1/validate-ip"; // Your validation endpoint
fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json' }})
.then(response => response.text()) // Expecting text response (not JSON)
.then(data => {
if (data.trim() === 'SUCCESS_200_OK') {
console.log("License Activated!");
} else {
console.log("License Deactivated!"); }})
.catch(error => console.error("Error:", error));
C#
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
string url = "http://127.0.0.1/validate-ip"; // Your validation endpoint
using (HttpClient client = new HttpClient())
{
HttpResponseMessage response = await client.PostAsync(url, null);
string responseString = await response.Content.ReadAsStringAsync();
if (responseString.Trim() == "SUCCESS_200_OK")
{
Console.WriteLine("License Activated!");
}
else
{
Console.WriteLine("License Deactivated!");}}}}
```
## Setup
- Insert ``INSERT.SQL`` into your mysql database.
- Edit ``secret_API`` inside of ``config.json`` then go to ``http://localhost/add-ip?KEY=YOURKEY``
## Reqirements
- Node.js **v16** or **Higher** is required.
- MySQL