{"id":231,"date":"2024-05-22T15:26:59","date_gmt":"2024-05-22T15:26:59","guid":{"rendered":"https:\/\/www.buddyupgo.com\/?page_id=231"},"modified":"2024-05-22T15:26:59","modified_gmt":"2024-05-22T15:26:59","slug":"login","status":"publish","type":"page","link":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/login\/","title":{"rendered":"Login"},"content":{"rendered":"<div class=\"buddyUpPjaxContainer\" data-buddyup-pjax-container=\"1\"><style>.hidden,.error-message{display:none}input{width:100%;display:block}body .buddyUpLoginTheme{max-width:550px;margin:0 auto;padding:2rem;min-height:430px}body.buddyup-login-pending{overflow:hidden}.buddyUp form{margin-bottom:0;position:relative}h2{padding-top:0}.loginFormButtonGroup{display:flex;justify-content:space-between;align-items:center;gap:.5rem}.loginFormButtonGroup>*{width:auto;margin:.5rem 0 0}.registerLink{font-weight:700;color:var(--primary-color)}.registerLink:hover{color:var(--primary-color);opacity:.8}.passwordInputWrapper{position:relative}.buddyUpLoginPendingOverlay{position:fixed;inset:0;z-index:200000;background:#0c0e1094;backdrop-filter:blur(2px);display:flex;align-items:center;justify-content:center;padding:1rem;pointer-events:auto;touch-action:none}.buddyUpLoginPendingModal{min-width:min(90vw,300px);max-width:360px;border-radius:16px;background:#fff;box-shadow:0 18px 40px #00000047;padding:1rem 1.1rem;display:flex;align-items:center;justify-content:center;gap:.75rem}.buddyUpLoginPendingModal p{margin:0;font-size:.96rem;font-weight:600;color:#2a2a2a}.buddyUpLoginSpinner{width:20px;height:20px;border-radius:50%;border:2px solid rgba(0,0,0,.2);border-top-color:var(--primary-color);animation:buddyUpLoginSpin .75s linear infinite}#buddyUpLogMeIn.is-loading{opacity:.92}@keyframes buddyUpLoginSpin{to{transform:rotate(360deg)}}#showPasswordButton{position:absolute;top:-50%;transform:translateY(50%);right:5px;margin:0;border:none;padding:0 10px;display:flex;align-items:center;font-size:.8rem}#showPasswordButton i{padding-top:2px}@media (max-width: 400px){.registerLink{display:block}}.buddyUpVerifyEmailModal{max-width:600px!important}.buddyUpVerifyEmailModal .buddyUpModalIcon{font-size:4rem;color:var(--primary-color);margin-bottom:1rem}.buddyUpVerifyEmailModal button{margin:.5rem 0}.buddyUpVerifyEmailModal button[disabled=disabled]{border:2px solid #c4c4c4!important;background:#c4c4c4!important;color:#2e2e2e!important}.buddyUpVerifyEmailModal #buddyUpEmailResendCountdown{font-size:.9rem;font-style:italic}.buddyUpVerifyEmailModalVerifying{max-width:500px!important}.buddyUpVerifyEmailModalVerifying .textHeading{margin-bottom:.5rem}.buddyUpVerifyEmailModalVerifying .buddyUpLoadingEl i,.buddyUpVerifyEmailModalVerifying .buddyUpModalIcon{font-size:2rem;margin-bottom:1rem;color:var(--primary-color)}.buddyUpVerifyEmailModalVerifying p{padding:0}\n<\/style>\n<div id=\"buddyUpLoginWrapper\" class=\"buddyUpLoginTheme hidden buddyUp\">\n    <div class=\"buddyUpPagesWrapper\">\n        <!-- Login Form -->\n        <img decoding=\"async\" src=\"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/wp-content\/plugins\/buddyup\/img\/trailer-image.webp\" alt=\"BuddyUp illustration\" class=\"buddyUpErrorPageImage\" style=\"margin: 0 auto 2rem;\">\n        <form id=\"buddyUpLoginTab\" class=\" mainLoginContainer buddyUpPage form \">\n            <h2>Login<\/h2>\n            <div class=\"buddyUpLoginFormWrapper\">\n                <div class=\"loginForm\">\n                    <div class=\"buddyup-input-group\">\n                        <label id=\"buddyup-emailLabel\" for=\"formEmail\" >Email<\/label>\n                        <input tabindex=\"0\" autocomplete=\"off\" type=\"text\"  id=\"formEmail\" placeholder=\" \" required \/>\n                        <div id=\"formEmailError\" class=\"error-message\">Please enter a valid email<\/div>\n                    <\/div>\n\n                    <div class=\"buddyup-input-group\">\n                        <label id=\"buddyup-pwLabel\" for=\"formPWD\" >Password<\/label>\n                        <div class=\"passwordInputWrapper\"><input tabindex=\"0\" autocomplete=\"off\" type=\"password\"  id=\"formPWD\" placeholder=\" \" required \/><button id=\"showPasswordButton\" aria-label=\"Show Password\" type=\"button\"><i class=\"fa fa-solid fa-eye fa-fw\"><\/i><\/button><\/div>\n                        <div id=\"formPWDError\" class=\"error-message\">Please enter a password<\/div>\n                    <\/div>\n\n                    <div id=\"formIncorrectInfo\" class=\"buddyUpErrorMessage hidden\">The information you entered is incorrect. Please try again.<\/div>\n                    \n                    <div style=\"text-align: right;\">\n                        <div style=\"margin-top: .5rem;\"><a role=\"button\" aria-label=\"Forgot your password?\" tabindex=\"0\" class=\"buddyUpGoToNextPage buddyUpLink\" data-next-page=\"buddyUpPwdTab\">Forgot your password?<\/a><\/div>\n                    <\/div>\n                    <div class=\"submitButtonWrapper\">\n                        <input type=\"submit\" value=\"Sign In\" role=\"button\" id=\"buddyUpLogMeIn\" aria-label=\"Login\" tabindex=\"0\" class=\"buddyUpButton1\">\n                    <\/div>\n                    \n                    <div style=\"text-align: center;\">\n                        <div>Don't have an account? <a aria-label=\"Create an account\" tabindex=\"0\" href=\"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/register\/\" class=\"registerLink\">Create an account<\/a><\/div>\n                        <!-- <div>Don't have an account? <a aria-label=\"Create an account\" tabindex=\"0\" href=\"#\" class=\"registerLink buddyUpGoToNextPage\" data-next-page=\"buddyUpRegTab\">Create an account<\/a><\/div> -->\n                    <\/div>\n                <\/div>\n            <\/div>\n        <\/form>\n        \n        <!-- Password Reset Form -->\n        <form id=\"buddyUpPwdTab\" class=\"buddyUpPage pwdWrapper form hidden\">\n            <div class=\"contentFormRegister buddyUpLoginFormWrapper\">\n                <div id=\"forgotPwdSuccess\" class=\"successBackground\"><\/div>\n                <h2>Reset your password<\/h2>\n                <p>Enter the email address associated with your account and we'll send you an email with a link to reset your password.<\/p>\n                <div class=\"buddyup-input-group\">\n                    <label id=\"resetEmail\" for=\"forgotPWDEmail\" ><span class=\"bold\">Email<\/span><\/label>\n                    <input tabindex=\"0\" required autocomplete=\"off\" type=\"text\"  id=\"forgotPWDEmail\" placeholder=\" \"\/>\n                    \n                    <div id=\"forgotPWDEmailError\"class=\"error-message\">Please enter a valid email<\/div>\n                <\/div>\n                <div class=\"loginFormButtonGroup\">\n                    <a role=\"button\" aria-label=\"Login to your account\" tabindex=\"0\" class=\"buddyUpGoToNextPage buddyUpGoBack\" data-next-page=\"buddyUpLoginTab\">Back to Sign in<\/a>\n                    <input type=\"submit\" value=\"Send\" role=\"button\" id=\"buddyUpSendForgotPwd\" aria-label=\"Reset password\" tabindex=\"0\" class=\"submit_button_1 buddyUpButton1\">\n                <\/div>\n            <\/div>\n        <\/form>\n    <\/div>\n\n    <div id=\"buddyUpLoginPendingOverlay\" class=\"buddyUpLoginPendingOverlay hidden\" aria-live=\"polite\" aria-atomic=\"true\" role=\"status\">\n        <div class=\"buddyUpLoginPendingModal\" aria-hidden=\"true\">\n            <span class=\"buddyUpLoginSpinner\" aria-hidden=\"true\"><\/span>\n            <p>Signing you in...<\/p>\n        <\/div>\n    <\/div>\n<\/div><script>const HYFIN_ENV=window.buddyUpVariables&&buddyUpVariables.hyfin_env?buddyUpVariables.hyfin_env:\"production\",buddyUpVerifyParams=new URLSearchParams(window.location.search||\"\"),buddyUpHasEmailVerificationParams=buddyUpVerifyParams.has(\"user_id\")&&buddyUpVerifyParams.has(\"verification_id\")&&buddyUpVerifyParams.has(\"validation_token\"),buddyUpPostLoginRedirectKey=\"buddyup_post_login_redirect\";let buddyUpLoginRequestInFlight=!1;function buddyUpSetLoginPendingState(t){const e=document.getElementById(\"buddyUpLogMeIn\"),i=document.getElementById(\"buddyUpLoginPendingOverlay\");e&&(t?(e.setAttribute(\"disabled\",\"disabled\"),e.classList.add(\"is-loading\"),e.value=\"Signing In...\"):(e.removeAttribute(\"disabled\"),e.classList.remove(\"is-loading\"),e.value=\"Sign In\")),i&&i.classList.toggle(\"hidden\",!t),document.body.classList.toggle(\"buddyup-login-pending\",!!t)}function buddyUpConsumeStoredPostLoginDestination(){const t=(()=>{try{return sessionStorage.getItem(buddyUpPostLoginRedirectKey)||localStorage.getItem(buddyUpPostLoginRedirectKey)||\"\"}catch{return\"\"}})(),e=String(t||\"\").trim();if(!e)return\"\";try{const i=new URL(e,window.location.origin);if(i.origin!==window.location.origin)return\"\";const o=`${i.pathname}${i.search}${i.hash}`;try{sessionStorage.removeItem(buddyUpPostLoginRedirectKey)}catch{}try{localStorage.removeItem(buddyUpPostLoginRedirectKey)}catch{}return o||\"\"}catch{return\"\"}}function buddyUpPostLoginDestination(){const t=buddyUpConsumeStoredPostLoginDestination();return t||(window.buddyUpVariables&&buddyUpVariables.for_me_link?buddyUpVariables.for_me_link:window.buddyUpVariables&&buddyUpVariables.home_link?buddyUpVariables.home_link:window.buddyUpVariables&&buddyUpVariables.account_link?buddyUpVariables.account_link:\"\/\")}async function buddyUpEnsureHyfinCustomerForUser(t){try{const e=t&&(t.id||t.user_id)?String(t.id||t.user_id):\"\";if(!e)return;const i=`buddyup_hyfin_customer_ensured_${e}_${HYFIN_ENV}`;if((()=>{try{return sessionStorage.getItem(i)===\"1\"}catch{return!1}})())return;const n=await BUDDYUP.apiRequest(\"account-get\",{id:e,fields:\"id,username,full_name,first_name,last_name,email_address,mobile_phone,user_subscription,subscription,subscription_tier,tier\"});if(!n||n.status!==\"success\")return;try{let s=typeof n.user_subscription<\"u\"?n.user_subscription:null;if(s=s===null&&typeof n.subscription<\"u\"?n.subscription:s,s=s===null&&typeof n.subscription_tier<\"u\"?n.subscription_tier:s,s=s===null&&typeof n.tier<\"u\"?n.tier:s,s=window.BUDDYUP&&typeof BUDDYUP.normalizeSubscriptionTier==\"function\"?BUDDYUP.normalizeSubscriptionTier(s):function(a){return a=parseInt(a),isNaN(a)&&(a=0),[0,1,2].includes(a)||(a=0),a}(s),t&&typeof t==\"object\"&&(t.user_subscription=s),window.BUDDYUP&&typeof BUDDYUP.setUser==\"function\"&&t&&typeof t==\"object\")BUDDYUP.setUser(t);else try{const a=window.localStorage?localStorage.getItem(\"buddyup_user\"):null,m=a?JSON.parse(a):t&&typeof t==\"object\"?t:{};m.user_subscription=s,localStorage.setItem(\"buddyup_user\",JSON.stringify(m))}catch{}}catch{}const d=(n.first_name||\"\").trim(),c=(n.last_name||\"\").trim(),r=(n.username||\"\").trim(),u=(n.full_name||\"\").trim(),y=(n.email_address||n.email||\"\").trim(),f=(n.mobile_phone||n.phone||n.mobile||\"\").trim(),l=await BUDDYUP.apiRequest(\"hyfin-fetch-customers\",{env:HYFIN_ENV,external_id:e});if(!(l&&l.status===\"success\"&&Array.isArray(l.records)?l.records:[]).find(s=>s&&String(s.external_id||\"\")===e)){const s=r!==\"\"?r:u!==\"\"?u:`${d} ${c}`.trim(),a={external_id:e,first_name:r||d||s.split(\" \")[0]||\"\",last_name:r?\"\":c||s.split(\" \").slice(1).join(\" \")||\"\",account_name:s!==\"\"?s:`BuddyUp User ${e}`,email:y,mobile_phone:f||void 0,active:!0};await BUDDYUP.apiRequest(\"hyfin-add-customer\",{env:HYFIN_ENV,...a})}try{sessionStorage.setItem(i,\"1\")}catch{}}catch{}}function buddyUpLooksLikeAuthSessionError(t){const e=String(t||\"\").toLowerCase();return e?e.includes(\"invalid user or token\")||e.includes(\"invalid user token\")||e.includes(\"authentication failed\")||e.includes(\"authentication required\")||e.includes(\"session expired\")||e.includes(\"user not found\"):!1}(async function(){const t=document.getElementById(\"buddyUpLoginWrapper\");t&&t.classList.remove(\"hidden\");const e=BUDDYUP.getCurrentUser();!(BUDDYUP&&typeof BUDDYUP.hasAuthenticatedUser==\"function\"?BUDDYUP.hasAuthenticatedUser(e):e&&e.id&&e.user_token)||buddyUpHasEmailVerificationParams||Promise.resolve().then(async()=>{const o=await BUDDYUP.apiRequest(\"account-get\",{id:e.id,fields:\"id\",_force:!0,_cb:Date.now()});if(o&&o.status===\"success\"){try{await buddyUpEnsureHyfinCustomerForUser(e)}catch{}BUDDYUP.pjaxNavigate(buddyUpPostLoginDestination());return}if(buddyUpLooksLikeAuthSessionError(o&&o.message))try{await BUDDYUP.logUserOut()}catch{}}).catch(()=>{})})();async function buddyUpLogUserIn(){if(buddyUpLoginRequestInFlight)return;buddyUpLoginRequestInFlight=!0;var t={};t.email_address=document.getElementById(\"formEmail\").value,t.password=document.getElementById(\"formPWD\").value;let e=!1;try{const i=await BUDDYUP.apiRequest(\"login\",t);if(i&&typeof i==\"object\"&&i.user_token&&i.status!==\"error\"){if(window.BUDDYUP&&typeof BUDDYUP.setUser==\"function\"){const o=BUDDYUP.setUser(i);o&&typeof o.catch==\"function\"&&o.catch(()=>{})}else localStorage.setItem(\"buddyup_user\",JSON.stringify(i));Promise.resolve().then(()=>buddyUpEnsureHyfinCustomerForUser(i)).catch(()=>{}),e=!0,BUDDYUP.pjaxNavigate(buddyUpPostLoginDestination())}else{let o=\"\";const n=i&&(i.message||i.data)?i.message||i.data:\"\";n&&n!==\"\"?n.includes(\"verify your email\")?(BUDDYUP.openModal(`<div class=\"textHeading\"><\/div>\n                        <p>Please verify your email before logging in.<\/p>\n                        <p>If you do not see a verification email in your inbox, <strong>please check the spam folder.<\/strong> or click below to send a new one.<\/p>\n                        <button id=\"buddyUpResendEmail\" class=\"buddyUpButton1\">Resend Email<\/button>`,\"Verify your email address\",\"buddyUpVerifyEmailModal\",{icon:\"fas fa-envelope-open-text\"}),document.getElementById(\"buddyUpResendEmail\").addEventListener(\"click\",()=>{buddyUpLoginResendEmailSetup(t.email_address)})):o=n:o=\"The information you entered is incorrect. Please try again.\",o!==\"\"&&(document.getElementById(\"formIncorrectInfo\").innerHTML=o,document.getElementById(\"formIncorrectInfo\").classList.remove(\"hidden\"))}}catch{document.getElementById(\"formIncorrectInfo\").innerHTML=\"Login request timed out. Please try again.\",document.getElementById(\"formIncorrectInfo\").classList.remove(\"hidden\")}finally{e||buddyUpSetLoginPendingState(!1),buddyUpLoginRequestInFlight=!1}}var loginSubmitButton=document.getElementById(\"buddyUpLoginTab\");loginSubmitButton&&loginSubmitButton.addEventListener(\"submit\",t=>{t.preventDefault(),!buddyUpLoginRequestInFlight&&(document.getElementById(\"formIncorrectInfo\").classList.add(\"hidden\"),buddyUpSetLoginPendingState(!0),buddyUpLogUserIn())});async function buddyUpForgotPassword(){document.getElementById(\"buddyUpSendForgotPwd\").setAttribute(\"disabled\",\"disabled\"),document.getElementById(\"formIncorrectInfo\").classList.add(\"hidden\");var t={};t.email_address=document.getElementById(\"forgotPWDEmail\").value;const e=await BUDDYUP.apiRequest(\"forgot-password\",t);document.getElementById(\"buddyUpSendForgotPwd\").removeAttribute(\"disabled\"),e&&e.status===\"success\"?BUDDYUP.openModal(\"Please check your email for instructions on how to reset your password.\",\"Password Reset Request\",\"passwordResetModal\"):BUDDYUP.openModal(\"An error occurred trying to reset your password.<br\/>Please try again later.\",\"An error occurred\",\"passwordResetModal\")}var passResetSubmit=document.getElementById(\"buddyUpPwdTab\");passResetSubmit&&passResetSubmit.addEventListener(\"submit\",t=>{t.preventDefault(),buddyUpForgotPassword()});var showPasswordButton=document.getElementById(\"showPasswordButton\");showPasswordButton&&showPasswordButton.addEventListener(\"click\",t=>{t.preventDefault();var e=t.target.parentNode.querySelector(\"i\"),i=document.getElementById(\"formPWD\");i.getAttribute(\"type\")===\"password\"?(i.setAttribute(\"type\",\"text\"),e.classList.remove(\"fa-eye\"),e.classList.add(\"fa-eye-slash\")):(i.setAttribute(\"type\",\"password\"),e.classList.remove(\"fa-eye-slash\"),e.classList.add(\"fa-eye\"))});function buddyUpLoginResendEmailSetup(t){BUDDYUP.openModal('<div id=\"buddyUpVerifyEmailWrapper\">Sending a new email verification...<\/div>',\"\",\"buddyUpVerifyEmailModal\"),buddyUpLoginResendEmailVerify(t)}async function buddyUpLoginResendEmailVerify(t){const e=await BUDDYUP.apiRequest(\"resend-verification-email\",{email:t});if(e.status===\"success\")BUDDYUP.openModal(`<p>We have sent a verification link to your email.<br\/>Click on the link to complete the verification process.<\/p>\n            <p>If you do not see the email, <strong>please check the spam folder.<\/strong><\/p>\n            <button id=\"buddyUpCloseModal\" class=\"buddyUpButton1\" style=\"margin: 0;\">Okay<\/button>`,\"Verify your email address\",\"buddyUpVerifyEmailModal\",{icon:\"fas fa-envelope-open-text\"}),document.getElementById(\"buddyUpCloseModal\").addEventListener(\"click\",()=>{BUDDYUP.closeModal()});else{const o=`<div id=\"buddyUpVerifyEmailWrapper\">\n            <p>We were unable to send a new email verification. Please try again.${e.message&&e.message!==\"\"&&!e.message.includes(\"route\")?`<br>${e.message}`:\"\"}<\/p>\n            <button id=\"buddyUpResentEmailAgain\" class=\"buddyUpButton1\">Resend Email<\/button>\n        <\/div>`;BUDDYUP.openModal(o,\"We're having some trouble\",\"buddyUpVerifyEmailModal\"),document.getElementById(\"buddyUpResentEmailAgain\").addEventListener(\"click\",()=>{buddyUpLoginResendEmailSetup(t)})}}if(buddyUpHasEmailVerificationParams){const t=`<div id=\"buddyUpVerifyEmailWrapper\">${BUDDYUP.loading()}<\/div><div class=\"textHeading\">Please Wait<\/div><p>Verifying your email<\/div>`;BUDDYUP.openModal(t,\"\",\"buddyUpVerifyEmailModalVerifying\"),BUDDYUP.clearAllElements(\"#buddyUpCloseModalButton\"),e(buddyUpVerifyParams.get(\"user_id\"),buddyUpVerifyParams.get(\"verification_id\"),buddyUpVerifyParams.get(\"validation_token\"));async function e(i,o,n){const d={user_id:i,verification_id:o,validation_token:n};if((await BUDDYUP.apiRequest(\"verify-email\",d)).status===\"success\"){var r=\"<p>Your email is verified.<br\/>Please log in to continue your adventure!<\/p>\";BUDDYUP.openModal(r,\"Verification Complete\",\"buddyUpVerifyEmailModalVerifying\",{icon:\"fas fa-envelope-open-text\"}),localStorage.setItem(\"buddyup_new_user\",!0);try{window.history&&typeof window.history.replaceState==\"function\"&&window.history.replaceState({},document.title,window.location.pathname)}catch{}}else{var r=\"<p>We seem to have hit a snag trying to verify your email. Please click the link in the verify email again to try again.<\/p>\";BUDDYUP.openModal(r,\"Something went wrong\",\"buddyUpVerifyEmailModal\",{icon:\"fas fa-exclamation-triangle\"})}}}\n<\/script><\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"templates\/full-width-no-header.php","meta":{"footnotes":""},"class_list":["post-231","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/api\/wp\/v2\/pages\/231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/api\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/api\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/api\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/api\/wp\/v2\/comments?post=231"}],"version-history":[{"count":0,"href":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/api\/wp\/v2\/pages\/231\/revisions"}],"wp:attachment":[{"href":"https:\/\/buddyupapi-staging.us35.cdn-alpha.com\/api\/wp\/v2\/media?parent=231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}