
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@mitreka/auth
Advanced tools
import { createAuth } from "@mitreka/auth";
import type { AccessToken, Authentication, TokenPair } from "@mitreka/types";
const USER_ID = "<UserID>";
const PASSWORD = "<Password>";
const PUBLIC_KEY = "<YourPublicKey>";
const AUTH_SERVICE_ENDPOINT = "<YourAuthServiceEndpoint>";
const login = async() => {
try {
const Auth: Authentication = await createAuth({
public: {
key: PUBLIC_KEY
},
url: AUTH_SERVICE_ENDPOINT
});
const tokenPair: TokenPair = await Auth.login(USER_ID, PASSWORD);
const session: AccessToken = await Auth.verifyToken(tokenPair.access_token);
console.log(session); // Login success
} catch (err: any) {
// Handle error
}
}
import { createAuth } from "@mitreka/auth";
import type { AccessToken, Authentication, TokenPair } from "@mitreka/types";
const PUBLIC_KEY = "<YourPublicKey>";
const AUTH_SERVICE_ENDPOINT = "<YourAuthServiceEndpoint>";
const REFRESH_TOKEN = "<YourRefreshToken>";
const refreshToken = async() => {
try {
const Auth: Authentication = await createAuth({
public: {
key: PUBLIC_KEY
},
url: AUTH_SERVICE_ENDPOINT
});
const tokenPair: TokenPair = await Auth.refreshToken(REFRESH_TOKEN);
const session: AccessToken = await Auth.verifyToken(tokenPair.access_token);
console.log(authSession); // Refresh success
} catch (err: any) {
// Handle error
}
}
Sometime we need to change the user role by default
import { createAuth } from "@mitreka/auth";
import type { AccessToken, Authentication, TokenPair } from "@mitreka/types";
const PUBLIC_KEY = "<PublicKey>";
const AUTH_SERVICE_ENDPOINT = "<AuthServiceEndpoint>";
const REFRESH_TOKEN = "<RefreshToken>";
const ROLE_ID = "<RoleID>";
const refreshToken = async() => {
try {
const Auth: Authentication = await createAuth({
public: {
key: PUBLIC_KEY
},
url: AUTH_SERVICE_ENDPOINT
});
const tokenPair: TokenPair = await Auth.refreshToken(REFRESH_TOKEN, {
role_id: ROLE_ID
});
const session: AccessToken = await Auth.verifyToken(tokenPair.access_token);
console.log(authSession); // Refresh success
} catch (err: any) {
// Handle error
}
}
FAQs
Mitreka Authentication
We found that @mitreka/auth demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.