Sign up/Login Library

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

作者
GamingwithMacon
版本
1
建立日期
2023-07-13
更新日期
2023-07-13
尺寸
3.9 KB
授權條款
未知

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.