Socket
Book a DemoInstallSign in
Socket

@slimplate/edge

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@slimplate/edge

Provides backend functions for GitHub authentication and a CORS proxy on Vercel

latest
Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
0
-100%
Maintainers
2
Weekly downloads
 
Created
Source

edge

These functions enable GitHub authentication and facilitate communication with external APIs while adhering to CORS policies in Vercel / Cloudflare Worker projects.

validRedir(redirectUrlString, url) // Checks if a URL matches wildcard patterns in redirectUrlString.
ghcallback(req, res, REDIRECT_URL, GITHUB_CLIENT, GITHUB_SECRET) // Handles GitHub OAuth callback, exchanges code for token, and redirects to authorized URL.
ghlogin(req, res, REDIRECT_URL, GITHUB_CLIENT) // Initiates GitHub login flow and redirects to GitHub OAuth authorization endpoint.
cors(req, res) // Acts as a CORS proxy for external API requests, handling headers and forwarding the request.

You can see a Vercel usage-example here.

Keywords

slimplate

FAQs

Package last updated on 13 Jun 2023

Did you know?

Socket

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.

Install

Related posts