Skip to content

Commit

Permalink
Merge branch 'feature-netlify-deploy-preview' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
luukee committed Oct 21, 2024
2 parents b51cd1f + 9d85ca2 commit 7c57507
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions context/AuthContext.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,14 @@ export const AuthContextProvider = ({children}) => {
const verifyEmail = (user) => {
return new Promise((resolve, reject) => {
const isDevelopment = window.location.hostname === 'localhost';
var actionCodeSettings = {
url: isDevelopment
? 'http://localhost:3001/login' // Use localhost during development
: 'https://caffeine-dashboard.netlify.app/login', // Use production URL
const actionCodeSettings = {
url: hostname === 'localhost'
? 'http://localhost:3001/login' // Local development URL
: hostname.includes('dev')
? 'https://dev--your-netlify-app.netlify.app/login' // Netlify dev branch URL
: 'https://caffeine-dashboard.netlify.app/login', // Production URL
handleCodeInApp: true,
};
}

sendEmailVerification(user, actionCodeSettings)
.then(() => {
Expand Down

0 comments on commit 7c57507

Please sign in to comment.