Skip to content

Commit

Permalink
app-auth
Browse files Browse the repository at this point in the history
  • Loading branch information
mongodb-atlas-app-services[bot] authored Jun 7, 2024
1 parent 7728ab5 commit 9fe912b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/app/data-enquc/auth/providers.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
"type": "api-key",
"disabled": false
},
"custom-function": {
"name": "custom-function",
"type": "custom-function",
"disabled": false,
"config": {
"authFunctionName": "authFunc"
}
},
"local-userpass": {
"name": "local-userpass",
"type": "local-userpass",
Expand Down
17 changes: 17 additions & 0 deletions src/app/data-enquc/functions/authFunc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

/*
This function will be run when a user logs in with this provider.
The return object must contain a string id, this string id will be used to login with an existing
or create a new user. This is NOT the App Services user id, but it is the id used to identify which user has
been created or logged in with.
If an error is thrown within the function the login will fail.
The default function provided below will always result in failure.
*/

exports = (loginPayload) => {
return;
};
4 changes: 4 additions & 0 deletions src/app/data-enquc/functions/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@
{
"name": "resetFunc",
"private": false
},
{
"name": "authFunc",
"private": true
}
]

0 comments on commit 9fe912b

Please sign in to comment.