# How to Capture the "code" Parameter After Facebook Social Login in Weweb?

**URL:** <https://community.weweb.io/t/how-to-capture-the-code-parameter-after-facebook-social-login-in-weweb/17261>\
**Category:** How do I?\
**Tags:** authentication\
**Created:** [March 18, 2025, 8:41am UTC](https://community.weweb.io/t/how-to-capture-the-code-parameter-after-facebook-social-login-in-weweb/17261 "2025-03-18T08:41:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vitorporanga](https://avatars.discourse-cdn.com/v4/letter/v/5f8ce5/32.png) [@Vitorporanga](https://community.weweb.io/u/Vitorporanga)\
**Post date:** [March 18, 2025, 8:41am UTC](https://community.weweb.io/t/how-to-capture-the-code-parameter-after-facebook-social-login-in-weweb/17261/1 "2025-03-18T08:41:15Z")

</div>

Hello everyone!

I’m implementing Facebook social login in my Weweb x Supabase application and I’m struggling to capture the “code” parameter that Facebook sends after authentication.

##What I’m trying to do:

I need to capture the “code” parameter from the URL after the OAuth redirect to make subsequent calls to the Meta Ads API. In Bubble, this functionality is simple to implement using the “Get code from page URL” action (as shown in the screenshot), but I haven’t found an equivalent solution in Weweb.

## The challenge:

The main issue is that the “code” parameter doesn’t appear visibly in the URL bar after the OAuth redirect. In Bubble, this seems to be handled automatically, but I need a Weweb-specific solution.

## What I’ve already tried:

I’ve attempted several JavaScript approaches in my workflows:

1. Using URLSearchParams to parse the query string
2. Checking both query parameters and URL fragments

However, none of these methods have successfully captured the “code” parameter consistently.

## My question to you:

Has anyone successfully implemented capturing the “code” parameter after Facebook login in Weweb? How did you do it?

Specifically, I’d like to know: **What is the recommended way to capture OAuth redirect parameters in Weweb?**

Thank you! And here’s the link to the software: [Agencify | AI Campaign Management for Agencies and Freelancers](https://agencifyapp.com/app)

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [March 18, 2025, 8:51am UTC](https://community.weweb.io/t/how-to-capture-the-code-parameter-after-facebook-social-login-in-weweb/17261/2 "2025-03-18T08:51:06Z")

</div>

If you know the parameter’s name you can simply go and create a query variable. You can also manipulate it as you would any other variable.

 ![Screenshot 2025-03-18 at 09.49.27](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/4/48d751bc4a822d49f4a3adf9507ee8fae78443df.png)

Then once you have the query string parameter in your editor’s URL, you can simply go and use it as a variable anywhere. For example this is my URL:

`https://editor.weweb.io/3b0d5d51-1589-4759-b376-9b1b71334244?mySecretCode=broberto_is_tha_goat`

 ![Screenshot 2025-03-18 at 09.50.28](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/f/f4dd0f302db1cbe3c12e148083bc5b606838a6e2.png)
