ich die ‚naive‘ Umsetzung im Projekt README befolgt haben: https://github.com/mondora/asteroid-oauth-mixinAsteroid Oauth loginServiceConfiguration: ‚google‘ undefinierter
Der einzige Unterschied in meinem Code aus dem Beispiel wird auf den Pfeil-Funktion zu einem traditionellen für die sich wandelnde Verwendung von diesem.
asteroid.ddp.on("added", ({collection, id, fields}: { collection: string; fields: {}, id: string }) => {
if (collection === "meteor_accounts_loginServiceConfiguration") {
asteroid.loginServiceConfiguration = {
...asteroid.loginServiceConfiguration,
[id]: {
_id: id,
...fields
}
};
}
});
});
asteroid.getServiceConfig = function(providerName: string) { // ts file
return this.loginServiceConfiguration[providerName];
}
Wenn ich asteroid.loginWith tun ('Google')
index.ts:50 Uncaught TypeError: Cannot read property 'google' of undefined
Auf dem Meteor-Backend auch ich meteor add accounts-base accounts-google
installiert, da ich nehme an, das eine Abhängigkeit ist.
Was fehlt mir? Vielen Dank!
Ich habe versucht, indem DDP.loginServiceConfiguration = {}
bevor das Snippet oben, die den Fehler behebt, sondern erstellt einen neuen Fehler.
asteroid-oauth-mixin.js:787 Uncaught TypeError: Cannot read property 'clientId' of undefined
at getOauthClientId (asteroid-oauth-mixin.js:787)
at Object.getOptions (asteroid-oauth-mixin.js:720)
at Asteroid.loginWith (asteroid-oauth-mixin.js:104)
at LoginForm../src/routes/accounts/auth/LoginForm.tsx.LoginForm.handleLoginWithGoogle (
Auch wenn ich laufe meteor mongo
sollte db.meteor_accounts_loginServiceConfiguration.find().count()
0 sein?