Sign up/Login Library

A library for securely storing and retrieving user credentials from JSONBin

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/470767/1219648/Sign%20upLogin%20%20Library.js

Author
longkidkoolstar
Version
1
Created
2023-07-13
Updated
2023-07-13
License
N/A

Signup/Login Library Documentation

Signup/Login Library Documentation

Description

The Signup/Login Library is a user script library that provides functionality for retrieving and saving user credentials using JSONBin.io. It can be used in conjunction with other user scripts to provide login and signup functionality.

Installation

To use the Signup/Login Library in your user scripts, you will need to include the following line in the metadata block at the top of your script:

// @require https://greasyfork.org/scripts/470767-sign-up-login-library/code/Sign%20upLogin%20%20Library.js

Usage

To use the Signup/Login Library in your user scripts, you will need to create a new instance of the LoginLibrary class and call its methods as needed.

Retrieving User Credentials

To retrieve user credentials from JSONBin.io, you can call the retrieveUserCredentials() method of the LoginLibrary class. This method will make a GET request to the JSONBin.io API and retrieve the user credentials.

Example:

const loginLibrary = new LoginLibrary();
loginLibrary.retrieveUserCredentials();

Saving User Credentials

To save user credentials to JSONBin.io, you can call the saveUserCredentials() method of the LoginLibrary class. This method will make a PUT request to the JSONBin.io API and save the user credentials.

Example:

const loginLibrary = new LoginLibrary();
loginLibrary.saveUserCredentials(username, password);

API Key

To use the Signup/Login Library, you will need to provide your JSONBin.io API key. You can do this by setting the binId and accessKey variables in the LoginLibrary class.

Example:

const binId = 'YOUR_BIN_ID_HERE';
const accessKey = 'YOUR_ACCESS_KEY_HERE';
const loginLibrary = new LoginLibrary(binId, accessKey);

You can find your JSONBin.io API key by logging into your account and navigating to the API keys page.