AIRTABLE User Sync

HI,

How can I solve this problem when working with an Airtable synchronized table?

Thks

You Can not alter field values of a synced table in airtable. You must copy its values to a new users table that can be written and edit it.

I copy the values by using a CSV file?
In case users are added to the synchronized table, these new users should also be copied manually?

Hi Jonathan @acjnas,

I reviewed previous conversations and found the explanation related to this topic. I already did the automation for the Users table and it works without problem. But I’m still having trouble creating the authentication app, taking into consideration that the user will have to login with email and password that will be provided via email invitation.
I have not been able to link the invitation to the new user and when entering his account, the application will redirect him to the magic link previously created.

Rgds.

You must setup a different new app to authenticate your users.
The most important field on this new users tab of this app being the magic link url that you collect and sync from your main app where user should land.

Hi @acjnas,

I did the exercise again but this time doing a reset to the user password to be able to log in with that email account, allowing me to log in without complications. The problem I have is related to the magic link, because when loading the user information in this new app (new user tab), Softr replaces the url delivered by a new one. So my question now is, how do I synchronize the original url and then not be replaced by new application? :thinking:

Rgds

You can have 2 or more magic links fields on your authentication app.

Let’s say users authenticate on your authentication app via magic link, then this magic link should also redirect user to another magic link/Page that will land the user into the right app and session.

The ‘magic link/Page’ will require a little coding, to pull the right magic link field and redirect the user accordingly.

Could you help me with this code or give me some indications to develop it?

Thks in advance

I will help you, just a little busy today, if you dont see answer before tomorrow afternoon, please DM me.

1 Like

Thanks a lot!!!

On your authentication app you must create a page where users will be redirected after successfully signing in. Now we get ready to redirect user to its final destination, to automatically authenticate to the right ‘cluster’

On this new page we need to automatically redirect the user to whatever value you have on your users tab “magic link 2” field (magic link value 1 being the atentication to this signing app )

See image:

And then the code for your signing app redirecting page:

<script>
document.addEventListener('DOMContentLoaded', function () {
    if (window['logged_in_user'] && window['logged_in_user']['softr_user_email']) {
        var redirectUrl = window['logged_in_user']['Magic link destino'];
        // Check if redirectUrl is not empty or undefined
        if (redirectUrl) {
            window.location.href = redirectUrl;
        }
        // Additional code here, if needed
    }
});
</script>
1 Like

Thanks @acjnas.
I followed the instructions and added the code to the app, it works great. Thank you very much for your help and generosity.

When the user sign out of the target application (magic link destino), how can I redirect him to the main page of the authentication app?

To close both user sesions, you need to set up in softr a small ‘loop’;

You must have ready an auto-logout page in your authenticating app.
So when user visits that page it automatically logs him out with a little javascript code.

Then, in one of your ‘cluster’ when users press the link to signout, it must be redirected to your authenticating app ‘auto-logout page’.

If you find is not possible to redirect user to a different domain or app when logout under the softr studio configs, then you must add a redirect script on the native logout destination page of your cluster to send the user to your authenticating app and also close session there.

Thanks again for your support.
The configuration for the logout is more complicated.
I better keep improving the application with all the tips you have given me :grin:.