Parse server login with protected /graphql route

Hello there, just starting out with Parse server and was wondering if there is any good login/logout/registration example with a protected /graphql route

I started out with this one: GitHub - parse-community/parse-server-example: Example of Parse Server using the express framework.

but I am not realy sure how to include graphql and ACL and protect the routes

my goal is that a route like this: https://server.com//login
would accept something like

POST https://server.com//login HTTP/1.1
X-Parse-Application-Id: app-id
X-Mobile-Installation-Id: install-id
OS: android
Connection: close
x-mobile-device-os-type: android
x-mobile-device-os-version: 10 (29)
x-mobile-device-type: device
x-mobile-app-id: some-app
x-mobile-app-version: 1.0
x-mobile-app-build: 101
x-mobile-app-source: google-play
Accept-Charset: UTF-8
Accept: */*
User-Agent: Ktor client
Content-Type: application/json
Content-Length: 110
Host: server.com
Accept-Encoding: gzip

{"username":"[email protected]","password":"password","temporaryPassword":null,"backupCode":null}

return something like this

{"objectId":"ph8aZqaBXA","lastPasswordChanged":{"__type":"Date","iso":"2024-03-18T09:52:17.509Z"},"roles":[],"agreementSigned":{"__type":"Date","iso":"2024-03-18T09:52:17.509Z"},"name":"Tester","userEmail":"[email protected]","email":"[email protected]","username":"[email protected]","account":"email","role":0,"allowResetPassword":false,"emailVerified":true,"createdAt":"2024-03-18T09:52:17.508Z","updatedAt":"2024-03-18T09:54:46.873Z",someCustomFieldHash":"cf28673fae18dcd88fe47","UserRole":{"__type":"Relation","className":"_Role"},"userRoles":{"__type":"Relation","className":"UserRole"},"radios":{"__type":"Relation","className":"Radio"},"ACL":{"pa8vGDTLXG":{"read":true,"write":true}},"sessionToken":"r:7618198a1g1ha6317k8975765f5009e3"}

then I would have protected /graphql route
that would accept request like this

POST https://server.com/graphql HTTP/1.1
X-Parse-Application-Id: app-id
X-Mobile-Installation-Id: install-id
X-Parse-Session-Token: r:7618198a1g1ha6317k8975765f5009e3
OS: android
Connection: close
x-mobile-device-os-type: android
x-mobile-device-os-version: 10 (29)
x-mobile-device-type: device
x-mobile-app-id: some-app
x-mobile-app-version: 1.0
x-mobile-app-build: 101
x-mobile-app-source: google-play
Accept-Charset: UTF-8
Accept: */*
User-Agent: Ktor client
Content-Type: application/json
Content-Length: 397
Host: server.com
Accept-Encoding: gzip

{"query":"{  some query }

and only if X-Parse-Session-Token was correct the route would allow request otherwise it would not allow them and get me {“code”:209,“error”:“Invalid session token”} back

Now I hope thats not to much to ask, but this would be a realy nice example as it would show everyone how to login and logout and register and also have one protected route /graphql in this case

So if anyone could make me an example like this that would be amazing, because right now I am a bit lost :grinning_face_with_smiling_eyes:

Thanks for Anwsering and Best Regards