Login programmatically and redirect

Hello,

I want to create an account from Landbot via a webhook to a custom endpoint that will trigger a backend workflow. This will create an account using an email and assign it a temp password and return them both.

{
“status”: “success”,
“response”: {
“email”: “testemail22@estemail222.com”,
“password”: “fB2}3?Pd”
}
}

I have another endpoint that will log the user in and return the credentials:

{
“status”: “success”,
“response”: {
“user_id”: “1596799539232x533729567063686600”,
“token”: “1596799988954x202787256425811300”,
“expires”: 31536000
}
}

This is to redirect Landbot to the dashboard url (https://myapp.com/dashboard) automatically without needing to force the user to log in. But I don’t know how to do it.

Should I do like with the API mechanism and just take the token’s value and attach it in an "Authorization: Bearer "?

Thank you