Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
payload-plugin-oauth
Advanced tools
Readme
Payload v2
npm install payload-plugin-oauth@^2
# or
yarn add payload-plugin-oauth@^2
Payload v1
npm install payload-plugin-oauth@^1
# or
yarn add payload-plugin-oauth@^1
// payload.config.ts
import path from 'path'
import { webpackBundler } from '@payloadcms/bundler-webpack'
import { mongooseAdapter } from '@payloadcms/db-mongodb'
import { slateEditor } from '@payloadcms/richtext-slate'
import axios from 'axios'
import { oAuthPlugin } from 'payload-plugin-oauth'
import { buildConfig } from 'payload/config'
import Users from './collections/Users'
export default buildConfig({
admin: {
user: Users.slug,
bundler: webpackBundler(),
},
editor: slateEditor({}),
collections: [Users],
typescript: {
outputFile: path.resolve(__dirname, 'payload-types.ts'),
},
graphQL: {
schemaOutputFile: path.resolve(__dirname, 'generated-schema.graphql'),
},
plugins: [
payloadCloud(),
oAuthPlugin({
databaseUri: process.env.DATABASE_URI,
clientID: process.env.OAUTH_CLIENT_ID,
clientSecret: process.env.OAUTH_CLIENT_SECRET,
authorizationURL: process.env.OAUTH_AUTH_ENDPOINT,
tokenURL: process.env.OAUTH_TOKEN_ENDPOINT,
callbackURL: process.env.OAUTH_CALLBACK_ENDPOINT,
async userinfo(accessToken) {
const { data: user } = await axios.get(
process.env.OAUTH_USERINFO_ENDPOINT,
{ headers: { Authorization: `Bearer ${accessToken}` } }
)
return {
sub: user.ID,
username: user.preferred_username,
}
},
}),
],
db: mongooseAdapter({
url: process.env.DATABASE_URI,
}),
})
Please see CHANGELOG for more information what has changed recently.
Contributions and feedback are very welcome.
To get it running:
npm install
npm run build
npm run fix
npm version minor
The MIT License (MIT). Please see License File for more information.
FAQs
<img src="https://img.shields.io/github/issues/thgh/payload-plugin-oau
The npm package payload-plugin-oauth receives a total of 246 weekly downloads. As such, payload-plugin-oauth popularity was classified as not popular.
We found that payload-plugin-oauth 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.