Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anonymize SSO users webId #1126

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/middleware/packages/auth/mixins/auth.sso.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const session = require('express-session');
const { v4: uuidv4 } = require('uuid');
const AuthMixin = require('./auth');
const saveRedirectUrl = require('../middlewares/saveRedirectUrl');
const redirectToFront = require('../middlewares/redirectToFront');
Expand Down Expand Up @@ -43,7 +44,7 @@ const AuthSSOMixin = {
accountData = await ctx.call('auth.account.create', {
uuid: profileData.uuid,
email: profileData.email,
username: profileData.username
username: profileData.username || uuidv4(),
});
webId = await ctx.call('webid.create', this.pickWebIdData({ nick: accountData.username, ...profileData }));
newUser = true;
Expand Down
3 changes: 2 additions & 1 deletion src/middleware/packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"passport-cas2": "0.0.12",
"passport-local": "^1.0.0",
"pug": "^3.0.2",
"url-join": "^4.0.1"
"url-join": "^4.0.1",
"uuid": "^9.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
5 changes: 5 additions & 0 deletions src/middleware/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10268,6 +10268,11 @@ uuid@^8.3.0:
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==

uuid@^9.0.0:
version "9.0.0"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.0.tgz#592f550650024a38ceb0c562f2f6aa435761efb5"
integrity sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==

valid-data-url@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/valid-data-url/-/valid-data-url-2.0.0.tgz#2220fa9f8d4e761ebd3f3bb02770f1212b810537"
Expand Down