
Research
/Security News
Laravel Lang Compromised with RCE Backdoor Across 700+ Versions
Laravel Lang packages were compromised with an RCE backdoor across hundreds of versions, exposing cloud, CI/CD, and developer secrets.
gasket-plugin-auth
Advanced tools
Add authentication to your Gasket apps in minutes using OpenAuth. Supports both modern Next.js App Router and Express applications.
npm install gasket-plugin-auth
Add the plugin to your gasket.js:
import { makeGasket } from '@gasket/core';
import pluginAuth from 'gasket-plugin-auth';
import { createSubjects } from "@openauthjs/openauth";
import { object, string } from "valibot";
const subjects = createSubjects({
user: object({
id: string(),
}),
});
export default makeGasket({
plugins: [
pluginAuth
],
auth: {
clientID: 'your-client-id',
issuer: 'https://your-auth-server.com',
subjects
}
});
// app/api/auth/login/route.ts
import { NextRequest } from 'next/server';
import gasket from '../../../../gasket';
import { loginHandler } from 'gasket-plugin-auth/api-routes';
const handler = (request: NextRequest) => loginHandler(gasket, request);
export { handler as GET };
// app/api/auth/callback/route.ts
import { NextRequest } from 'next/server';
import gasket from '../../../../gasket';
import { callbackHandler } from 'gasket-plugin-auth/api-routes';
const handler = (request: NextRequest) => callbackHandler(gasket, request);
export { handler as GET };
// app/protected/page.tsx
import gasket from '../../../gasket';
import { NextTokenStore } from 'gasket-plugin-auth/token-store/next';
export default async function ProtectedPage() {
const store = new NextTokenStore();
const verified = await gasket.actions.verifyAuthSession(store);
if (!verified) {
return <div>Not authenticated</div>;
}
return (
<div>
<h1>Protected Page</h1>
<pre>{JSON.stringify(verified.subject, null, 2)}</pre>
</div>
);
}
// middleware.ts
export async function middleware(request: NextRequest) {
if (url.pathname.includes('/protected')) {
const res = await fetch(new URL('/api/auth/verify', url), {
headers: {
cookie: request.headers.get('cookie') || ''
}
});
const { verified } = await res.json();
if (!verified || verified.err) {
return NextResponse.redirect(new URL('/api/auth/login', request.url));
}
}
return NextResponse.next();
}
// app/layout.tsx
import { AuthProvider } from 'gasket-plugin-auth/auth-context';
export default function RootLayout({ children }: { children: React.ReactNode }) {
return <AuthProvider><div>{children}</div></AuthProvider>;
}
// components/AuthButton.tsx
import { useAuth } from 'gasket-plugin-auth/hooks';
export function AuthButton() {
const { isAuthenticated, isLoading, signIn, signOut } = useAuth();
// ...
}
import { createAuthMiddleware } from 'gasket-plugin-auth/middleware';
app.use('/protected/*', createAuthMiddleware(gasket));
import { ExpressTokenStore } from 'gasket-plugin-auth/token-store/express';
app.get('/profile', async (req, res) => {
const store = new ExpressTokenStore(req, res);
const verified = await gasket.actions.verifyAuthSession(store);
if (!verified) {
return res.redirect('/login');
}
res.json({ user: verified.subject });
});
The plugin provides these Gasket actions:
verifyAuthSession(store) - Verify the current sessionsetAuthTokens(store, access, refresh) - Set auth tokensgetAuthTokens(store) - Get current tokensclearAuthTokens(store) - Clear auth tokensFAQs
gasket plugin for oauth
We found that gasket-plugin-auth demonstrated a not healthy version release cadence and project activity because the last version was released 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.

Research
/Security News
Laravel Lang packages were compromised with an RCE backdoor across hundreds of versions, exposing cloud, CI/CD, and developer secrets.

Security News
Socket found a malicious postinstall hook across 700+ GitHub repos, including PHP packages on Packagist and Node.js project repositories.

Security News
Vibe coding at scale is reshaping how packages are created, contributed, and selected across the software supply chain