[oidcProvider] trustedClients don't get added to the OauthApplication table in the database.
I have set up two Next.js apps, both with better-auth.
One serves as an oidc provider (https://idapp.appname.local), with the oidcProvider plugin installed.
The other serves as a consumer of the oidc provider (https://clientapp.appname.local), with the generic oAuth plugin installed.
However, when I try to sign in using the oAuth plugin I get the following error:
Furthermore, in the console of the idApp, I get the following logs:
After some investigation, I noticed that the OauthApplications table in the database is empty.
Even after running
the table is still empty.
It seems as if the trustedClients: object in the oidcProvider's config should automatically add these records to the database, but it does not.
One serves as an oidc provider (https://idapp.appname.local), with the oidcProvider plugin installed.
The other serves as a consumer of the oidc provider (https://clientapp.appname.local), with the generic oAuth plugin installed.
However, when I try to sign in using the oAuth plugin I get the following error:
oauth_code_verification_failedFurthermore, in the console of the idApp, I get the following logs:
After some investigation, I noticed that the OauthApplications table in the database is empty.
Even after running
npx @better-auth/cli generate followed by npx prisma db push,the table is still empty.
It seems as if the trustedClients: object in the oidcProvider's config should automatically add these records to the database, but it does not.