Disable auth completely? #1645
Replies: 5 comments 3 replies
-
What you are looking for is |
Beta Was this translation helpful? Give feedback.
-
I think the only other thing you need is to add your own auth middleware function that sets the user object on
|
Beta Was this translation helpful? Give feedback.
-
Okay, updated server.ts const app = express();
app.use((req, res, next) => {
req.user = {
id: "Anonymous",
};
next();
}); payload.config.ts export default buildConfig({
...
admin: {
user: Users.slug,
},
collections: [
Users,
]
}); Users.ts const Users: CollectionConfig = {
slug: 'users',
auth: {
disableLocalStrategy: true,
},
admin: {
useAsTitle: 'email',
group: "Global",
},
access: {
read: () => true,
},
fields: [
// Email added by default
// Add more fields as needed
],
}; I now see a blank screen on localhost:3000/admin, |
Beta Was this translation helpful? Give feedback.
-
I managed to solve this issue this way: My problemI want to enable my users (defined by Users collection) to log in using Google, Facebook, ... For this, I implemented my own authentication/authorization logic and put SolutionCreate a new collection (Admins). And use that collection to log in into the admin panel. On this collection, I didn't put |
Beta Was this translation helpful? Give feedback.
-
If Payload is hosted somewhere which is already auth'd, are there any examples/guidance on how to simply 'turn off' the built in auth?
I've googled, but most of the answers I can find are just around plugging in different strategies (with no samples), and steering people towards "enterprise" offerings.
Beta Was this translation helpful? Give feedback.
All reactions