
Product
Unify Your Security Stack with Socket Basics
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.
@easyv/opg-client
Advanced tools
OP 网关代理客户端,用于代理嵌入式 OP 登录,登录状态查询等功能。
npm install @easyv/opg-client
使用以下方法,快速接入 op-proxy-gateway
应用 | 环境 | clientId | issuer |
---|---|---|---|
DTable | 开发环境 | dtable | http://dtable.op.develop:1866 |
import { EmbeddedClient } from '@easyv/opg-client';
const client = new EmbeddedClient({
issuer: 'xxxxxx',
clientId: 'xxxxxx',
});
client.checkLoginState((data) => {
// 使用 data 中的 isLoggedIn 属性判断当前访问者是否在 OP 登录过
});
client.login((data) => {
if (data.isNewAccount) {
// ...
} else {
// ...
}
// 自定义业务逻辑,会在登录成功弹窗关闭后执行
});
client.implicitLogin(() => {
// 自定义业务逻辑,会在登录成功后执行
});
当接口返回 418 未授权时,查看访问者在 OP 的登录状态使用不同的方法来登录
client.checkLoginState((data) => {
if (data.isLoggedIn) {
// 用户已经在 OP 登录,使用隐式登录
client.implicitLogin();
} else {
// 用户未在 OP 登录,根据业务决定是否弹出登录窗口
client.login();
}
});
FAQs
op proxy gateway client
We found that @easyv/opg-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 11 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.
Product
Socket is launching experimental protection for the Hugging Face ecosystem, scanning for malware and malicious payload injections inside model files to prevent silent AI supply chain attacks.
Research
/Security News
The Socket Threat Research Team uncovered a coordinated campaign that floods the Chrome Web Store with 131 rebranded clones of a WhatsApp Web automation extension to spam Brazilian users.