Post

Replies

Boosts

Views

Activity

Reply to "Apple Sign-in button not working on Heroku web app: troubleshooting help needed"
Sorry should have replied here... not comment...I tried changing the environment to 'production' but the button still isnt working. do you need any other code? Here is my js code //* CONFIGURING CLOUDKIT & ICLOUD USER AUTHENTICATION CloudKit.configure ({ containers: [{ containerId: process.env.ICLOUD_CONTAINER, apiTokenAuth: { apiToken: process.env.ICLOUD_API_KEY, persist: true, // keeps user signed in after closing/reopening browser useAuth: true }, environment: 'development' // or 'production' }] }); // Logging process.env values function main() { console.log(process.env.ICLOUD_CONTAINER); console.log(process.env.ICLOUD_API_KEY); console.log(process.env.ICLOUD_REDIRECT_URI); } document.addEventListener("DOMContentLoaded", main); CloudKit.on('error', (error) => { console.error(error); }); CloudKit.getAuthStatus().then(function(response) { if(response.status === 'AUTHORIZED') { console.log('User is already signed in'); landingPage.classList.add("hide"); flashCardPage.classList.remove("hide"); fetchAlbums(); } else { console.log('User is not signed in'); signInBtn.addEventListener("click", () => { CloudKit.signIn({ scope: 'email', redirectURI: process.env.ICLOUD_REDIRECT_URI }).then((response) => { console.log(response); if(response.isSuccess) { landingPage.classList.add("hide"); flashCardPage.classList.remove("hide"); userIdentity = response.userIdentity; fetchAlbums(); } else { console.error('Error signing in:', response.error); }; }); }); }; });
Topic: App & System Services SubTopic: iCloud Tags:
Feb ’23
Reply to "Apple Sign-in button not working on Heroku web app: troubleshooting help needed"
Sorry should have replied here... not comment...I tried changing the environment to 'production' but the button still isnt working. do you need any other code? Here is my js code //* CONFIGURING CLOUDKIT & ICLOUD USER AUTHENTICATION CloudKit.configure ({ containers: [{ containerId: process.env.ICLOUD_CONTAINER, apiTokenAuth: { apiToken: process.env.ICLOUD_API_KEY, persist: true, // keeps user signed in after closing/reopening browser useAuth: true }, environment: 'development' // or 'production' }] }); // Logging process.env values function main() { console.log(process.env.ICLOUD_CONTAINER); console.log(process.env.ICLOUD_API_KEY); console.log(process.env.ICLOUD_REDIRECT_URI); } document.addEventListener("DOMContentLoaded", main); CloudKit.on('error', (error) => { console.error(error); }); CloudKit.getAuthStatus().then(function(response) { if(response.status === 'AUTHORIZED') { console.log('User is already signed in'); landingPage.classList.add("hide"); flashCardPage.classList.remove("hide"); fetchAlbums(); } else { console.log('User is not signed in'); signInBtn.addEventListener("click", () => { CloudKit.signIn({ scope: 'email', redirectURI: process.env.ICLOUD_REDIRECT_URI }).then((response) => { console.log(response); if(response.isSuccess) { landingPage.classList.add("hide"); flashCardPage.classList.remove("hide"); userIdentity = response.userIdentity; fetchAlbums(); } else { console.error('Error signing in:', response.error); }; }); }); }; });
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Feb ’23
Reply to "Apple Sign-in button not working on Heroku web app: troubleshooting help needed"
So then the issue with my button is code related? When I press the button nothing happens. It doesnt load the sign in page or anything. Like a dead button.
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Feb ’23