feat(login): new login flow (MIN-281)
3 unresolved threads
3 unresolved threads
Add new login flow - Design link
Flow: Login after authorization:
- For "user": close login modal
- For "curator/admin": show new dialog with options "Back to the map" and "Go to the admin panel"
For both users, the icon changes to "logged in"
Reopening login for logged-in user:
For "user":
- Switch account -> back to login
- Logout
For "curator/admin":
- Go to the admin panel
- Switch account -> back to login
- Logout
Additionally, the login button has been removed in the overlay drawer at Marek's request
Closes MIN-281
Merge request reports
Activity
Filter activity
assigned to @mateusz-winiarczyk
added 7 commits
-
dd2b4f07...9def2152 - 6 commits from branch
development
- b5e99f49 - Merge remote-tracking branch 'origin/development' into MIN-281-login-information
-
dd2b4f07...9def2152 - 6 commits from branch
5 import { projectIdSelector } from '@/redux/project/project.selectors'; 6 import { Button } from '@/shared/Button'; 7 import { useRouter } from 'next/router'; 8 import React from 'react'; 9 10 export const LoggedInMenuModal = (): React.ReactNode => { 11 const dispatch = useAppDispatch(); 12 const router = useRouter(); 13 const projectId = useAppSelector(projectIdSelector); 14 15 const closeLoggedInMenuModal = (): void => { 16 dispatch(closeModal()); 17 }; 18 19 const goToTheAdminPanel = (): void => { 20 router.push(`${ADMIN_PANEL_URL}?id=${projectId}`); changed this line in version 4 of the diff
11 import { hasPrivilege } from './user.utils'; 12 13 const getUserRole = async (login: string): Promise<string> => { 14 const response = await axiosInstance.get<UserPrivileges>(apiPath.userPrivileges(login), { 15 withCredentials: true, 16 }); 17 18 const { 19 data: { privileges }, 20 } = response; 21 22 if (hasPrivilege(privileges, 'IS_ADMIN')) { 23 return USER_ROLE.ADMIN; 24 } 25 if (hasPrivilege(privileges, 'IS_CURATOR')) { 26 return USER_ROLE.CURATOR; 11 import { hasPrivilege } from './user.utils'; 12 13 const getUserRole = async (login: string): Promise<string> => { 14 const response = await axiosInstance.get<UserPrivileges>(apiPath.userPrivileges(login), { 15 withCredentials: true, 16 }); 17 18 const { 19 data: { privileges }, 20 } = response; 21 22 if (hasPrivilege(privileges, 'IS_ADMIN')) { 23 return USER_ROLE.ADMIN; 24 } 25 if (hasPrivilege(privileges, 'IS_CURATOR')) { 26 return USER_ROLE.CURATOR; added 7 commits
-
b5e99f49...b97f69ab - 6 commits from branch
development
- 6ae568e3 - Merge remote-tracking branch 'origin/development' into MIN-281-login-information
-
b5e99f49...b97f69ab - 6 commits from branch
added 1 commit
- 61b7eb6d - refactor(login): extract string to constant and add test for curator
reset approvals from @AdrianOrlow by pushing to the branch
mentioned in commit c74e3377
Please register or sign in to reply