I am having a new error now at iOS only, Supertokens throws this "Please provide a valid domain name...
r
I am having a new error now at iOS only, Supertokens throws this "Please provide a valid domain name":
Copy code
(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(r))?"http://"+i.host:"https://"+i.host:i.protocol+"//"+i.host}catch(e){}if(t.startsWith("/"))throw Error("Please provide a valid domain name");if(0===t.indexOf(".")&&(t=t.substr(1)),(-1!==t.indexOf(".")||t.startsWith("localhost"))&&!t.startsWith("http://")&&!t.startsWith("https://")){t="https://"+t;try{return new URL(t),e(t,!0)}catch(e){}}throw Error("Please provide a valid domain name")}(e)}},29996:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0
My app info:
Copy code
const appInfo = {
  appName: 'Lokalist Business',
  apiDomain: GET_FRONTEND_URL(),
  websiteDomain: 'dashboard.lokalist.mobile.app',
  apiBasePath: '/api/auth',
  websiteBasePath: '/auth',
}
Copy code
export const GET_FRONTEND_URL = () => {
  if (process.env.NEXT_PUBLIC_APP_STAGE === 'production' && process.env.NODE_ENV === 'production') {
    return 'https://dashboard.lokalist.nl'
  }
  if (process.env.NEXT_PUBLIC_APP_STAGE === 'development' && process.env.NODE_ENV === 'production') {
    return 'https://staging-dashboard.lokalist.nl'
  }

  return 'http://localhost:2001'
}
What could it be? The origin is
capacitor://localhost
r
@nkshah2 can help here
n
Can you try adding the protocol to the website domain?
https://dashboard.lokalist.mobile.app
for example
r
let me see
no its not that
could you check in the supertokens code where this error could come from?
n
In your error logs, can you see if its coming from the frontend sdk or the backend?
r
I will DM you the logs
Soo I fixed it, it was apparently some API route that was not working, this line of code broke it:
Copy code
const response = (await (await fetch(`https://staging-url.com/api/auth/knock`)).json()) as z.infer<
I am sorry to have bothered you, but the error stated that it was related to Supertokens, which caused the confusion! Haha. Thanks for helping @nkshah2, as friendly as always 🙂
n
Haha no worries, glad you got it to work!
39 Views