A library for securely storing and retrieving user credentials from JSONBin
此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.cn-greasyfork.org/scripts/470767/1219648/Sign%20upLogin%20%20Library.js
Signup/Login Library Documentation
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.
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.jsTo 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.
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();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);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.