Mongo Atlas Realm Anonymous Login - 400

I am getting the following error when I try to login to realm app with anonymous credentials. This has been working without any issues before. But it seems like it doesn’t work anymore.

Error: Request failed (POST https://ap-southeast-1.aws.realm.mongodb.com/api/client/v2.0/app/<APP_ID>/auth/providers/anon-user/login): TypeError: Cannot access member 'db' of undefined (status 400)
    at bundle.dom.es.js:2852:24
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (asyncToGenerator.js:3:1)
    at _next (asyncToGenerator.js:22:1)
    at _ZoneDelegate.invoke (zone.js:375:26)
    at Object.onInvoke (core.mjs:24210:33)
    at _ZoneDelegate.invoke (zone.js:374:52)
    at Zone.run (zone.js:134:43)
    at zone.js:1278:36
    at _ZoneDelegate.invokeTask (zone.js:409:31)
    at resolvePromise (zone.js:1214:31)
    at resolvePromise (zone.js:1168:17)
    at zone.js:1281:17
    at _ZoneDelegate.invokeTask (zone.js:409:31)
    at core.mjs:23896:55
    at AsyncStackTaggingZoneSpec.onInvokeTask (core.mjs:23896:36)
    at _ZoneDelegate.invokeTask (zone.js:408:60)
    at Object.onInvokeTask (core.mjs:24197:33)
    at _ZoneDelegate.invokeTask (zone.js:408:60)
    at Zone.runTask (zone.js:178:47)

Can someone please tell me what the problem is?

@Kanchana_Senadheera You have context.services.get("MongoDB") but there is no MongoDB service. It is mongodb-atlas is the service name

Hello Ian, thanks for the reply.

However, I am not sure if I understood the problem correctly. Can you please elaborate?