This repository has been archived by the owner on Oct 21, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tools): add visability of auth0 rules (#108)
* feat(tools): add visability of auth0 rules * fix(ns): update ns
- Loading branch information
1 parent
6fd836b
commit 222fd18
Showing
4 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## Auth0 Rules | ||
|
||
The functions held in this directory have no direct effect inside the open-api, but are held here for visability and code review. | ||
|
||
They are subject to a manual deploy process, that is to say, we copy/paste them inside the Auth0 dashboard. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* eslint-disable */ | ||
|
||
/* | ||
Function name should be removed for deployment | ||
uuid is global inside Auth0 Rules | ||
https://auth0.com/docs/appliance/modules | ||
*/ | ||
|
||
function addAccountLinkId(user, context, callback) { | ||
const namespace = 'https://auth-ns.freecodecamp.org/'; | ||
user.app_metadata = user.app_metadata || {}; | ||
user.app_metadata.accountLinkId = user.app_metadata.accountLinkId || uuid(); | ||
context.idToken[namespace + 'accountLinkId'] = | ||
user.app_metadata.accountLinkId; | ||
|
||
callback(null, user, context); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters