Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 142 additions & 5 deletions bun.lock

Large diffs are not rendered by default.

701 changes: 701 additions & 0 deletions examples/with-website/pnpm-lock.yaml

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions examples/with-website/src/collections/Auth/Admin/Users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { authenticated } from '@/access/authenticated'
import type { CollectionConfig } from 'payload'
import { deleteLinkedAccounts } from 'payload-auth-plugin/collection/hooks'
import { AdminAccounts } from './Accounts'
export const AdminUsers: CollectionConfig = {
import { withUsersCollection } from 'payload-auth-plugin/collection'
export const AdminUsers: CollectionConfig = withUsersCollection({
slug: 'users',
access: {
admin: authenticated,
Expand Down Expand Up @@ -30,4 +31,4 @@ export const AdminUsers: CollectionConfig = {
hooks: {
afterDelete: [deleteLinkedAccounts(AdminAccounts.slug)],
},
}
})
17 changes: 10 additions & 7 deletions examples/with-website/src/components/AfterLogin/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
'use client'

import './styles.scss'
import React from 'react'

import { Button } from '@payloadcms/ui'
import './styles.scss'
import { adminAuthClient } from '@/lib/auth'

export const AdminLogin = () => {
const { oauth } = adminAuthClient.signin()

const handleGoogleSignin = async () => {
oauth('google')
}
const handleAuth0Signin = async () => {
oauth('auth0')
}
const handleGoogleSignin = async () => oauth('google')
const handleAuth0Signin = async () => oauth('auth0')
const handleMicrosoftSignin = async () => oauth('msft-entra')

return (
<div className="oauth-container">
<Button type="button" onClick={handleGoogleSignin} className="oauth-btn">
Expand All @@ -21,6 +21,9 @@ export const AdminLogin = () => {
<Button type="button" onClick={handleAuth0Signin} className="oauth-btn">
Signin with Auth0
</Button>
<Button type="button" onClick={handleMicrosoftSignin} className="oauth-btn">
Signin with Microsoft
</Button>
</div>
)
}
Loading