# Redirect to url after signup (from within rule?)

**URL:** <https://community.auth0.com/t/redirect-to-url-after-signup-from-within-rule/61252>\
**Category:** Get Help\
**Created:** [April 16, 2021, 4:40pm UTC](https://community.auth0.com/t/redirect-to-url-after-signup-from-within-rule/61252 "2021-04-16T16:40:39Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [April 16, 2021, 5:49pm UTC](https://community.auth0.com/t/redirect-to-url-after-signup-from-within-rule/61252/7 "2021-04-16T17:49:13Z")

</div>

Oh, I see! Yes, the application would handle the redirect in that case instead of a rule.

You could alter your rule to instead add a flag in the ID token that will let your app know that the user requires onboarding:

```auto
function (user, context, callback) {
  var loginCount = context.stats && context.stats.loginsCount ? context.stats.loginsCount : 0;
  var namespace = "http://your-app-uri"; // a namespace is required for custom claims to avoid collision
  
  if (loginCount <= 1) {
    context.idToken[namespace + 'requiresOnboarding'] = true;
  }
  
  return callback(null, user, context);
}

```

Here is info about setting up a single callback URL in your app that handles redirects:  
[https://community.auth0.com/t/how-do-i-set-up-a-dynamic-allowed-callback-url/60268](https://community.auth0.com/t/how-do-i-set-up-a-dynamic-allowed-callback-url/60268)

---

_[View the full topic](https://community.auth0.com/t/redirect-to-url-after-signup-from-within-rule/61252)._
