Unknown field 'WRDAUTH_LANGUAGE' in value #0 for type WRD_AUTHDOMAIN

7 views
Skip to first unread message

Wouter Hendriks

unread,
Jun 30, 2025, 8:48:37 AMJun 30
to General WebHare developers discussion
What's the best way to fix this?

Updating schema 'wvuaw:wvuaw' because a dependency was modified: mod::wrd/data/wrdschemas/authschema.xml
Failed to apply metadata updates to WRD schema 'wvuaw:wvuaw': Unknown field 'WRDAUTH_LANGUAGE' in value #0 for type WRD_AUTHDOMAIN

Removed the attribute from WRD schema interface but doesn't help.

Arnold Hendriks

unread,
Jun 30, 2025, 8:50:45 AMJun 30
to General WebHare developers discussion, Wouter Hendriks
> Unknown field 'WRDAUTH_LANGUAGE' in value #0 for type WRD_AUTHDOMAIN

Don't attempt to set WRDAUTH_LANGUAGE in your wrdschema. Just grep for it

Arnold Hendriks

unread,
Jun 30, 2025, 8:51:31 AMJun 30
to General WebHare developers discussion, Arnold Hendriks, Wouter Hendriks
(in fact just delete everything that has to do with wrd_authdomain, it's been completely ignored for a few versions already)

Wouter Hendriks

unread,
Jun 30, 2025, 9:11:23 AMJun 30
to General WebHare developers discussion, Arnold Hendriks, Wouter Hendriks
Whoops, my search didn't find "wrdauth_language" for some reason. Probably searched wrong.

Did indeed still have a

```
  <object tag="wrd_authdomain">
    <values matchattribute="wrd_tag">
      <value>
        <field tag="wrd_title">Dealers</field>
        <field tag="wrd_tag">WVUAW_DEALERS</field>
        <field tag="wrdauth_language">nl</field>
        <field tag="wrdauth_lastloginfield">LASTLOGIN</field>
        <field tag="wrdauth_lastipfield">LASTIP</field>
      </value>
    </values>
  </object>
```

Removed it altogether,  that part works now, thanks.

Got a new problem however:

Uncaught (in promise) Error: RPC Error: Cannot find attribute ["email"] in type 'wvuaw:wvuaw.wrdPerson'
    at runSimpleWRDQuery (/Users/wouter/projects/webhare/whtree/modules/wrd/js/internal/queries.ts:192:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async WRDType.search (/Users/wouter/projects/webhare/whtree/modules/wrd/js/internal/schema.ts:679:18)
    at async IdentityProvider.lookupUser (/Users/wouter/projects/webhare/whtree/jssdk/auth/src/identity.ts:708:18)
    at async IdentityProvider.handleFrontendLogin (/Users/wouter/projects/webhare/whtree/jssdk/auth/src/identity.ts:741:20)
    at async login (/Users/wouter/projects/webhare/whtree/modules/platform/js/auth/harescript.ts:75:20)
    at async workerHandleCall (/Users/wouter/projects/webhare/whtree/modules/platform/js/nodeservices/calljs.ts:83:14)
    at async WorkerHandler.gotMessage (/Users/wouter/projects/webhare/whtree/modules/system/js/internal/worker_handler.ts:50:24)
    at CALLJS (wh::javascript.whlib:198:25)
    at WRDAUTHPLUGIN#__DOLOGINTS (mod::wrd/lib/internal/auth/webdesignplugin.whlib:743:22)
    at LOGINFORM#SUBMIT (mod::wrd/lib/internal/pages/authpages.whlib:132:34)
    at FORMBASE#FORMEXECUTESUBMIT (mod::publisher/lib/forms/base.whlib:812:23)
    at RPC_FORMSUBMIT (mod::publisher/lib/internal/forms/rpc.whlib:41:29)
    at DOCHECKEDVARARGSCALL (mod::system/lib/internal/remoting/support.whlib:184:23)
    at EXECUTESERVICECALL (mod::system/lib/internal/remoting/server.whlib:361:21)
    at ControlledCall._completeCall (http://localhost:8001/.wh/ea/ap/wvuaw_dealerwel.dealerwel/ap.mjs:5929:19)
    at async RPCFormBase.submit (http://localhost:8001/.wh/ea/ap/wvuaw_dealerwel.dealerwel/ap.mjs:9628:22)
    at async RPCFormBase._doSubmit (http://localhost:8001/.wh/ea/ap/wvuaw_dealerwel.dealerwel/ap.mjs:7729:24)
    at async RPCFormBase._submit (http://localhost:8001/.wh/ea/ap/wvuaw_dealerwel.dealerwel/ap.mjs:7698:7)

This is my schemadef:

                  accountemailfield="email"
                  accountloginfield="email"
                  accountpasswordfield="password"
                  accounttype="dealer"

Code looks to called hardcoded for "wrdPerson":

  async lookupUser(authsettings: WRDAuthSettings, loginname: string, customizer?: AuthCustomizer, jwtPayload?: JWTPayload | undefined, options?: LoginUsernameLookupOptions): Promise<number | null> {
    ...
    const user = await this.wrdschema.search("wrdPerson", authsettings.loginAttribute as AttrRef<WRD_Idp_WRDPerson>, loginname);
    return user || null;
  }

Arnold Hendriks

unread,
Jun 30, 2025, 9:54:19 AMJun 30
to General WebHare developers discussion, Wouter Hendriks, Arnold Hendriks
Does it help to replace that line with 

    const user = await (this.wrdschema as AnyWRDSchema).search(authsettings.accountType, authsettings.loginAttribute as AttrRef<WRD_Idp_WRDPerson>, loginname);

We already realized we're not testing enough against unusual accounttype settings, but it turns out we're not actually using that anywhere. So more cases might fall through, and we're considering whether to just hardcode it to wrdPerson for a more robust API. (We're already running into this with other modules (Eg 'connect') where you can theoretically have separate domains of users (there its 'connect Agent') but it breaks down or overcomplicates things in practice)

Especially with the wrdauthAccountStatus field it should become easier to have all kinds of persons and explicitly mark those that are allowed to login by setting the accountStatus

Wouter Hendriks

unread,
Jun 30, 2025, 10:09:35 AMJun 30
to General WebHare developers discussion, Arnold Hendriks, Wouter Hendriks
Yeah, that helps. But needed to replace in 2 more places in identity.ts:

line 487: const subjectValue = (await (this.wrdschema as AnyWRDSchema).getFields("wrdPerson", subject, [subfield]))?.[subfield] as string;
line 1081: const addUserInfo = await wrdSchema.getFields("wrdPerson", userId, getfields);

Arnold Hendriks

unread,
Jun 30, 2025, 10:15:27 AMJun 30
to General WebHare developers discussion, Wouter Hendriks, Arnold Hendriks
MR welcome, or maybe I'll get around to it somewhere this week
Reply all
Reply to author
Forward
0 new messages