Skip to content
This repository has been archived by the owner on Mar 25, 2022. It is now read-only.

[fbcnms-auth] Fix error getting user info #172

Open
wants to merge 1 commit into
base: main
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
2 changes: 1 addition & 1 deletion fbcnms-packages/fbcnms-auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fbcnms/auth",
"version": "0.1.6",
"version": "0.1.7",
"dependencies": {
"@fbcnms/sequelize-models": "^0.1.11",
"@fbcnms/webpack-config": "^0.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function OrganizationOIDCStrategy(config: Config) {
userInfo: OpenidUserInfoClaims,
done: (error: Error | void, user?: User) => void,
) => {
const email = userInfo.email;
const email = userInfo.email || userInfo.attributes.email;
const organization = await req.organization();
const ssoDefaultNetworkIDs = organization.ssoDefaultNetworkIDs;
try {
Expand All @@ -46,7 +46,7 @@ export default function OrganizationOIDCStrategy(config: Config) {
email: email.toLowerCase(),
password: Math.random().toString(36),
// Hardcoded role for now, should be configurable
role: AccessRoles.SUPERUSER,
role: AccessRoles.USER,
ssoDefaultNetworkIDs,
});
user = await User.create(createArgs);
Expand Down Expand Up @@ -75,6 +75,7 @@ export default function OrganizationOIDCStrategy(config: Config) {
path: `${config.urlPrefix}/login/oidc/callback`,
passReqToCallback: true,
params: {
scope: ['openid email'],
redirect_uri:
`https://${host}${config.urlPrefix}/login/oidc/callback?to=` +
encodeURIComponent(redirectTo),
Expand Down
2 changes: 1 addition & 1 deletion fbcnms-packages/fbcnms-platform-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@fbcnms/platform-server",
"version": "0.3.3",
"dependencies": {
"@fbcnms/auth": "^0.1.6",
"@fbcnms/auth": "^0.1.7",
"@fbcnms/babel-register": "^0.1.0",
"@fbcnms/express-middleware": "^0.1.5",
"@fbcnms/logging": "^0.1.0",
Expand Down