FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    Is there a way to send the user to the hosted signup or login form when opening?

    Scheduled Pinned Locked Moved
    Q&A
    3
    4
    6.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      shanon
      last edited by

      Re: Social providers in Register web page

      I would prefer that the form open directly to 'sign up' or 'log in' - is it possible to send a url parameter or something that would show the form in the preferred 'mode'? If the user already knows that they need to sign up, I'd rather show them that first, and vice versa.

      1 Reply Last reply Reply Quote 0
      • robotdanR
        robotdan
        last edited by

        Are you asking to send the user directly to the register page? If so, yes, this is possible.

        The URL is mostly the same, but the base is /oauth2/register instead of /oauth2/authorize.

        If you click the view icon on your application, you will see a Registration URL or Registration URLs depending upon how many redirect URLs you have configured.

        view_dialog.png

        1 Reply Last reply Reply Quote 0
        • danD
          dan
          last edited by

          Hiya,

          I think you are asking: "can I show someone a login link if I know they have an account and otherwise show a registration link"?

          If so, I believe this is best done in your application. Drop a cookie hasLoggedIn once the user has logged in. Make it persistent and don't remove it on log out. Then, in your application code, if the user has a hasLoggedIn cookie but isn't currently logged in, display a sign in link.

          There are three possibilities:

          • the browser has never visited your site before (the user could have, but could have removed their cookies or be on a new computer--no way to know that). You know this because of the absence of the hasLoggedIn cookie. Show a registration link.
          • the browser has visited your site before and is logged in. You should show neither reg nor login, but you'll probably have a session or cookie indicator that they have signed in.
          • the browser has visited your site before and is not logged in (which you know because of the hasLoggedIn cookie). You should show login, with a link to registration (because it could be someone else on the user's computer who wants to sign up).

          --
          FusionAuth - Auth for devs, built by devs.
          https://fusionauth.io

          1 Reply Last reply Reply Quote 0
          • S
            shanon
            last edited by

            Ok, thanks @dan and @robotdan ! I think a combination of both your responses gets me what I need. Much appreciated!

            1 Reply Last reply Reply Quote 1
            • First post
              Last post