Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

access is working fine in localhost but 403 in server

default discord avatar
abdullahasad72532 years ago
4

Able to login but not able to update when deployed on server. Working fine in localhost

  • default discord avatar
    paulpopus2 years ago

    what exactly are you trying to do? and what errors do you see in your console?

  • default discord avatar
    abdullahasad72532 years ago

    not able to update or delete when access is import type { Access, AccessArgs } from 'payload/config'



    import type { Access } from "payload/types";


    import { checkRole } from "./checkRole";



    const adminsAndUser: Access = ({ req: { user } }) => {


    if (user) {


    if (checkRole(['admin'], user)) {


    return true


    }


    return {


    id: { equals: user.id },


    };


    }



    return false;


    };



    export default adminsAndUser;



    403 forbidden


    errors


    :


    [{message: "You are not allowed to perform this action."}]



    api/payload-preferences/locale route returns {"message":"Not Found","value":null}



    but working fine in localhost



    Used backend url in cors csrf and cookies-domain

  • default discord avatar
    paulpopus2 years ago

    nice to see you got it solved!

  • default discord avatar
    jarrad_347365 months ago

    Can you share any further detail on your solve? I've been troubleshooting this exact problem for days

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.