Terence Eden. He has a beard and is smiling.
Theme Switcher:

Auth0 - Adding Twitter Screen Names to a User with Actions

· 200 words


Grrrr. Auth0 have a nifty service to let users log in to your site using a social network. Users don't need an account with you, they can sign in with Twitter, Facebook, GitHub, etc.

But there's a bug which is five years old. Auth0 doesn't show the screen name of Twitter users (e.g. @edent).

There was a workaround using their "rules" product. But rules are being removed next month and we all need to transition to "Actions". Why? Because fuck you, that's why. Auth0 have decoded that fixing bugs is less important than updating their logo yet again despite having updated it a couple of years ago.

Anyway, here's the new action you need:

 JavaScriptexports.onExecutePostLogin = async (event, api) => {
  // Set the nickname to be the screen_name for Twitter connections
  if (event.connection.name === 'twitter' && event.user.screen_name) {
    api.idToken.setCustomClaim('nickname', event.user.screen_name);
  } 
};

Thanks to Gianfranco Parascandolo for helping me figure it out.


Share this post on…

What are your reckons?

All comments are moderated and may not be published immediately. Your email address will not be published.

See allowed HTML elements: <a href="" title="">
<abbr title="">
<acronym title="">
<b>
<blockquote cite="">
<br>
<cite>
<code>
<del datetime="">
<em>
<i>
<img src="" alt="" title="" srcset="">
<p>
<pre>
<q cite="">
<s>
<strike>
<strong>

To respond on your own website, write a post which contains a link to this post - then enter the URl of your page here. Learn more about WebMentions.