Auth Login component misunderstanding

Hello, I started configure my first rest api resource with custom api and faced the next problems:

  1. I can't change display name for Form:
    code-name: some_long_field_name
    Display name: Some long display name
  2. I can't display auth state to resource for user in my page:
    Not Logged in -> only Login button
    Logged in -> Complete navigation header
  3. In resource settings only "Login test URL", but I want to have also one workflow (but not critical)
  4. After pressing "Check authentication status using current credentials" in the "not auth" case, it says: "Auth modal will appear (you are not authenticated)". When does this executed in my app? I cannot explicitly call this, but when I use this resource in a query, it only fails to fetch data and the modal form does not open.
  5. About "Auth login" component.
    It opens form modal (as in worlkflow). But if I close modal with close button, Auth login component state not updates, it continues to "loading" until page refresh (All login buttons for this resource, inquery "re-auth" buttons too)

My Custom Auth workflow:

  1. form modal (get credentials from user)
  2. api request (request to auth service)
  3. define variable (save accesst token from response into variable "AUTH_TOKEN")

I think my workflow is correct, because using in correct way (enter (in-)correct credentials) it returns correct result, and other queries uses received token

Could you please explain to me what is happening on each item? I would like to understand why something is going wrong, is it my fault or the component's bug, etc.

Hello @railbariev1,

Can you share some screenshots of how you have the resource auth set up?

  1. I am not sure what you mean by 'display name' for the Form

  2. Once a user has successfully authed in, you can run queries with that resource which you can chain to 'on success' events to display components such as a navigation header.

  3. Are you taking about Retool Workflows or the auth workflow?

  4. When a user triggers an event, such as a button click or when a query on a protect resource runs, it will prompt the user the auth in.

Check out these docs here for setting up custom API auth.

Hello again

  1. For example, I have next form:
    image
    But for user I want to display "Username" or other word (or localized)
    instead of "username"

  2. Can you please explain to me with more details
    I have a stack with 2 views:
    image
    How I can get value defined in auth workflow:
    image
    Or I should use other approach?
    ** How I can convert variable to true/false?

  3. I meant that in custom API auth settings:
    image
    I have an URL that returns json, which contains "active" property in body. However endpoint always returns 200 StatusCode

  4. Ok, I will test It again, maybe for correct work in my resource should be defined Login Test URL or other props

Hi @railbariev1

  1. You can capitalize the U in the Username input key. You unfortunately cannot make it localized.

2. isAuthorized is a variable in your auth flow, and thus can't be referenced in the app.

Usually if someone needs to determine if a user is authorized, they'll run a query to the resource in the app and check the status of the query (401, not authorized).

The login test url checks to see if it's a non 2xx response and then prompts the user to login. If it always returns a 200, then it won't work.

You need to have the test login run, return a correct code based on if they provide the correct info or not. Then you can set a variable as you did with localStorage to set the view to non-authed if they did not successfully auth in to the resource.