
Security News
Open Source Maintainers Feeling the Weight of the EU’s Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
next14-auth-steam
Advanced tools
steam authentication provider for next-auth14.
// pages/api/auth/[...nextauth].ts
import { NextApiRequest, NextApiResponse } from 'next'
import NextAuth from 'next-auth'
import SteamProvider from 'next14-auth-steam'
export default function handler(req: NextApiRequest, res: NextApiResponse) {
return NextAuth(req, res, {
providers: [
SteamProvider(req, {
clientSecret: process.env.STEAM_SECRET!,
callbackUrl: 'http://localhost:3000/api/auth/callback'
})
]
})
}
// app/api/auth/[...nextauth]/route.ts
async function handler(
req: NextRequest,
ctx: {
params: {
nextauth: string[]
}
}
) {
// @ts-ignore
return NextAuth(req, ctx, {
providers: [
SteamProvider(req, {
clientSecret: process.env.STEAM_SECRET!,
callbackUrl: 'http://localhost:3000/api/auth/callback'
})
]
})
}
export {
handler as GET,
handler as POST
}
To obtain all data of Steam user, use these two callbacks to retrieve user's information:
https://next-auth.js.org/getting-started/example#using-nextauthjs-callbacks
import { PROVIDER_ID } from 'next-auth-steam'
// ...
return NextAuth(req, res, {
providers: [
SteamProvider( ... )
],
callbacks: {
jwt({ token, account, profile }) {
if (account?.provider === PROVIDER_ID) {
token.steam = profile
}
return token
},
session({ session, token }) {
if ('steam' in token) {
// @ts-expect-error
session.user.steam = token.steam
}
return session
}
}
})
Other examples are in examples folder.
FAQs
Steam authentication provider for next-auth
The npm package next14-auth-steam receives a total of 5 weekly downloads. As such, next14-auth-steam popularity was classified as not popular.
We found that next14-auth-steam 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.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.