Implement the external login with Apple your Front-Commerce project using passport-applehttps://www.npmjs.com/package/passport-apple and following Front-Commerce documentation
✅ Front-Commerce = 2.13+
- Install the latest stable version for the module
npm install ph2m/front-commerce-external-login-apple#1.1.0
- Generate your Apple credential for Apple auth feature: https://github.com/ananay/apple-auth/blob/master/SETUP.md#configuring-the-library
- Add your own configuration on the
.env
file
[Required] FRONT_COMMERCE_APPLE_CLIENT_ID
[Required] FRONT_COMMERCE_APPLE_CLIENT_TEAM_ID
[Required] FRONT_COMMERCE_APPLE_KEY_ID
[Optional] FRONT_COMMERCE_APPLE_DEFAULT_FIRSTNAME => set default firstname to user who create account with external auth Apple
[Optional] FRONT_COMMERCE_APPLE_DEFAULT_LASTNAME => set default firstname to user who create account with external auth Apple
- Create
.externalLoginAppleAuthKey.p8
file in your project root directory and past inside content of yourAuthKey.p8
- Load the module on
.front-commerce.js
file Is important to load./node_modules/front-commerce-external-login-apple
module before./node_modules/front-commerce/modules/auth-external-login
modules: [
...
"./node_modules/front-commerce-external-login-apple",
//"./node_modules/front-commerce/modules/auth-external-login",
],
webModules: [
...
{
name: "FrontCommerceConversionsApi",
path: "./node_modules/front-commerce-external-login-apple/web",
},
],
- Include Apple login button by the including following components
+ import AppleSignIn from "theme/components/atoms/SignInButton/AppleSignIn";
+ <AppleSignIn />