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

Dev users + typo in scrollbar component #154

Merged
merged 25 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
74a79b2
Installed server-only and next-auth
FelipeTrost Oct 19, 2023
95356b0
MS: endpoint for fetching ability rules
FelipeTrost Oct 19, 2023
b08d43d
MS2: implemented nextauth and refacored auth code
FelipeTrost Oct 19, 2023
d63b50b
Use nextauth cookies for auth in old ms
FelipeTrost Oct 19, 2023
ebc72d0
Example .env.local file
FelipeTrost Oct 19, 2023
2040b77
Changed page to be rendered on the server
FelipeTrost Nov 8, 2023
6f8563e
Double submit cookie csrf protection
FelipeTrost Nov 8, 2023
3339f02
Local development users
FelipeTrost Nov 8, 2023
8a543d4
Transformed page to be a server component
FelipeTrost Nov 8, 2023
bcd7fa7
use environments for auth and auth0 is optional in dev
FelipeTrost Nov 11, 2023
aa29cb4
Enabled redirects in AuthCan
FelipeTrost Nov 11, 2023
a096ed9
Added missing commands
FelipeTrost Nov 11, 2023
3effaed
Feature flag for auth0 + ms api script
FelipeTrost Nov 11, 2023
ce8eb27
Merge branch 'main' into nextauth-for-ms
FelipeTrost Nov 11, 2023
202c19b
Fallback user avatar
FelipeTrost Nov 11, 2023
c723564
Updated readme
FelipeTrost Nov 11, 2023
1776731
Fixed typos
FelipeTrost Nov 11, 2023
6b0ffb4
Fixed typo
FelipeTrost Nov 15, 2023
e2dfef6
Use http instead of https when API_ONLY
FelipeTrost Nov 15, 2023
d6c4582
useAuth0 is set in environments
FelipeTrost Nov 15, 2023
6d6c4c9
Environments have to be added in manually
FelipeTrost Nov 15, 2023
504c9e9
Merged 'main'
FelipeTrost Nov 15, 2023
f88e818
Fix: always create dev users in development
FelipeTrost Nov 15, 2023
58e9bad
Typo
FelipeTrost Nov 15, 2023
c5711cc
Merge branch 'main' into nextauth-ms2
OhKai Nov 15, 2023
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 src/management-system-v2/components/scrollbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const ScrollBar: FC<ScrollBarType> = ({
setThumbHeight(newThumbHeight);
setScrollPosition(newScrollPosition);
}
}, [reachedEndCallBack, scrolledToTH, threshhold]);
}, [reachedEndCallBack, scrolledToTH, threshold]);

const handleScrollbarClick = useCallback((e: MouseEvent) => {
if (containerRef.current && thumbRef.current) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ const getClient = async (config) => {
await createAdminUser();
}

if (process.env.NODE_ENV === 'development') await createDevelopmentUsers();

// set global roles for authorization
const globalRoles = { everybodyRole: '', guestRole: '' };
for (const role of getRoles()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async function createUser(user: User, role?: any) {
if (role) addRoleMappingForUser(newUser, role);
}

export async function createDevelopmentUsers() {
export async function createDevelopmentUsers(config) {
const roles = await getRoles();

const processAdminRole = roles.find((role) => role.name === '@process_admin');
Expand Down Expand Up @@ -116,7 +116,9 @@ export async function createDevelopmentUsers() {
},
adminRole,
);
} else {
}

if (config.useAuth0) {
await createUser(
{
given_name: 'John',
Expand Down
3 changes: 3 additions & 0 deletions src/management-system/src/backend/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import getClient from './iam/authentication/client.js';
import { getStorePath } from '../shared-electron-server/data/store.js';
import { abilityMiddleware, initialiazeRulesCache } from './iam/middleware/authorization';
import { getSessionFromCookie } from './iam/middleware/nextAuthMiddleware.js';
import { createDevelopmentUsers } from './iam/utils/developmentUsers';

const configPath =
process.env.NODE_ENV === 'development'
Expand Down Expand Up @@ -107,6 +108,8 @@ async function init() {
}
}

if (process.env.NODE_ENV === 'development') await createDevelopmentUsers(config);

if (process.env.API_ONLY) {
backendServer.use(getSessionFromCookie(config));
} else {
Expand Down