
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@withkoji/auth
Advanced tools
User authentication for Koji templates.
The @withkoji/auth package enables you to authenticate users in Koji templates. This package provides methods for determining the current user’s role (whether or not the user created the Koji). It also enables the template to send notifications to the creator’s Koji account.
[DEPRECATED] This package is deprecated and is included only for backwards compatibility. For new templates, use @withkoji/core.
Install the package in the frontend and backend services of your Koji project.
npm install --save @withkoji/auth
NOTE: To support instant remixes of your template, you must also install the @withkoji/vcc package and implement the VccMiddleware
on your backend server. This middleware maintains the environment variables for instant remixes, ensuring that user authentication applies to the correct remix version.
Instantiate Auth
on the frontend.
import Auth from '@withkoji/auth';
const auth = new Auth();
Get the user's short-lived callback token and include it with a request to an appropriate backend route.
const token = await auth.getToken();
fetch('/backend/some/admin/route', {
method: 'GET',
headers: {
authorization: token,
},
});
Instantiate Auth
on the backend and use it to verify the user's role.
import Auth from '@withkoji/auth';
app.get('/backend/some/admin/route', async (req, res) => {
const auth = new Auth(
res.locals.KOJI_PROJECT_ID,
res.locals.KOJI_PROJECT_TOKEN,
);
const role = await auth.getRole(req.headers.authorization);
if (role !== 'admin') {
res.sendStatus(401);
return;
}
// access granted
});
See the contributions page on the developer site for info on how to make contributions to Koji repositories and developer documentation.
For any questions, reach out to the developer community or the @Koji Team
on our Discord server.
FAQs
User authentication for Koji templates
The npm package @withkoji/auth receives a total of 6 weekly downloads. As such, @withkoji/auth popularity was classified as not popular.
We found that @withkoji/auth demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.