PricingBlog

Redirects on mobile

  • samuelt_19895-1282826117585305661

    Samuel T

    1 year ago

    Hi guys, everything works fine on a pc, login, logout redirects
    But on the phone, when I login it just redirects back to login
    I've tried clearing cache and also incognito but nothing worked
  • samuelt_19895-1282843551985565727

    Samuel T

    1 year ago

    Maybe it has something to do with the toddle extension?
  • frankenwompus-1282884519279726693

    Fisher

    1 year ago

    Out of curiosity, is your phone's browser getting the site in "Desktop Mode" ?
  • building_stuff-1282942256206188644

    Janis

    1 year ago

    Did you set “prevent default” on your login form submission event?
  • max.kayr-1282950851375267881

    Max

    1 year ago

    Can you share the project URL? Then I or someone else can have a look
  • samuelt_19895-1282967004785152036

    Samuel T

    1 year ago

    Thank you!
  • samuelt_19895-1282967789224591361

    Samuel T

    1 year ago

    https://peia_affiliates.toddle.site/
    Does this work?
    To explain, I have a workflow on the main page /dashboard that calls a "login" api on load, and if it fails, redirects to /login
    It works good on desktop, but on mobile always redirects back to login
  • @Fisher I don't know 😅
  • @Janis I will try that
    👍1
  • samuelt_19895-1283008791314694176

    Samuel T

    1 year ago

    @Janis I tried that but the issue persists
  • 1099731993052319824-@Samuel T
    Thank you!
    frankenwompus-1283019791065419806

    Fisher

    1 year ago

    Most phone browsers have a "desktop mode" setting, where the browser then behaves like a desktop and not a phone. Trying it in that mode might help narrow down the issue.
  • building_stuff-1283022335968022580

    Janis

    1 year ago

    Can you send a screenshot of your login flow and the actions?
  • max.kayr-1283024216198742057

    Max

    1 year ago

    Hey @Samuel T! The go to url action has to go in the success branch of the set cookie action
    1283024215863459840-image.png
  • samuelt_19895-1283044057245024298

    Samuel T

    1 year ago

    @Max It looks like this
    1283044056565547028-Screenshot_2024-09-10_at_14.37.38.png
    1283044056926261380-Screenshot_2024-09-10_at_14.37.27.png
  • samuelt_19895-1283044459273130004

    Samuel T

    1 year ago

    @Janis I don't think mine does, plus I've tested other phones and browsers
    But that should not even cause an issue right? Whether desktop or mobile
  • max.kayr-1283045258372059146

    Max

    1 year ago

    The screenshot I shared is from your project @Samuel T
    This is on the login page. You should call the "go to URL" action in the success branch of the set cookie action. Otherwise it can happen that the cookie is not set
  • samuelt_19895-1283046874496106526

    Samuel T

    1 year ago

    Makes so much sense. And it worked, thank you @Max !
  • max.kayr-1283047128893100053

    Max

    1 year ago

    Sure 💪
  • samuelt_19895-1283048345795039244

    Samuel T

    1 year ago

    But do you have any idea why I wasnt having the same issue on desktop?
  • max.kayr-1283050595900592148

    Max

    1 year ago

    I assume that the desktop was just faster and was able to set the cookie before the next action hit.
  • samuelt_19895-1283090400290279517

    Samuel T

    1 year ago

    Got it 🙂
  • samuelt_19895-1283170364016300172

    Samuel T

    1 year ago

    @Max One last question about this - in order to redirect anyone who's not logged in from the dashboard to login, I created a workflow but I don't know if that's the right setup. Can you kindly have a look?
  • samuelt_19895-1283259034060980236

    Samuel T

    1 year ago

    Was asking cos when you click the links in the nav bar to change pages a few times, it redirects you to the login page at some point as if you are not authenticated
  • max.kayr-1283277769601712184

    Max

    1 year ago

    Did you change your project to private? I cannot check the code anymore. My best guess is that you are running on Xano free trial and that you hit your API limits. Could be the reason why the call throws an error
  • lucasg-1283279690110337066

    Lucas G

    1 year ago

    Or the expiry on the token is set too short
  • max.kayr-1283290569870802965

    Max

    1 year ago

    True, did not think of that 😅
  • samuelt_19895-1283386072428056638

    Samuel T

    1 year ago

    The expiry is set to 3600
  • lucasg-1283420853887045653

    Lucas G

    1 year ago

    Yeah that’s low
  • samuelt_19895-1283469675853778984

    Samuel T

    1 year ago

    @Lucas G What's a recommended number?
  • lucasg-1283473043003412502

    Lucas G

    1 year ago

    That's up to you. I think 3600 is recommended for security usually but you have to run the refresh token that often
  • I'm fine for my uses to leave it for a week instead of an hour lol
  • lucasg-1283473517341311038

    Lucas G

    1 year ago

    Which would be 604800
  • It can also depend on what the max is for your backend
  • samuelt_19895-1283609095609258046

    Samuel T

    1 year ago

    Makes sense - thanks @Lucas G