How do you handle callbacks with this?
Looks like quave
has moved this into the mainstream, since you can now signInWithApple
Install these two https://atmospherejs.com/quave/accounts-apple, https://atmospherejs.com/quave/apple-oauth
meteor add quave:accounts-apple
meteor add quave:apple-oauth
Set up the config
in settings.json
alongside facebook and google oauth
per this guide.
settings.json :
"apple": {
"teamId": "yyexamplexx",
"clientId": "com.example.client",
"keyId": "zzexamplewq",
"secret": "zxcvsdfasdfexamplezlongstrxcvsdfasdf",
"redirectUri": "https://example.com/apple-redirect"
},
Client :
continueWithApple = () => {
Meteor.loginWithApple({}, function(err, res) {
if (err) {
console.log(err);
}
//running ok
});
};
<Form.Button
id="appleid-signin"
fluid
basic
className="continue apple"
data-color="black"
data-border="true"
data-type="sign in"
onClick={() => {
this.continueWithApple();
}}
>
Server:
// I had to initialize the loginWithAppleā¦
setupAppleConfig: async () => {
console.log("setting up apple config for login...");
Accounts.loginServiceConfiguration.remove({
service: "apple"
});
Accounts.loginServiceConfiguration.insert({
service: "apple",
clientId: "com.example.client",
responseType: "code",
responseMode: "query",
redirectUri: "https://example.com/apple-redirect",
scope: "name email"
});
},
Opens a popup, which prompts you to login, then redirects you to the redirectUri
, but how do you handle this redirect auth?