Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dashboard
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
red-giant
dashboard
Merge requests
!52
Change folder structure and fix auth flow.
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Change folder structure and fix auth flow.
rebase
into
dev
Overview
0
Commits
8
Pipelines
2
Changes
1
Merged
Defendi Alberto
requested to merge
rebase
into
dev
3 years ago
Overview
0
Commits
8
Pipelines
2
Changes
1
Expand
0
0
Merge request reports
Viewing commit
3f0b421b
Prev
Next
Show latest version
1 file
+
2
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Verified
3f0b421b
Change rendering condition and Cleanup.
· 3f0b421b
Defendi Alberto
authored
3 years ago
src/components/Authorization/Authorization.tsx
+
2
−
4
Options
@@ -18,9 +18,7 @@ interface WithAuthProps {
allowedRoles
:
string
[];
}
interface
Props
extends
WithAuthProps
{
children
:
React
.
ReactNode
;
}
// FIX: Sometimes the login page is displayed the circle rather than the login page.
/* eslint-disable react/jsx-props-no-spreading */
/**
@@ -42,7 +40,7 @@ export const withAuthorization = <T extends WithAuthProps = WithAuthProps>(
console
.
log
(
`ROLE
${
role
}
AUTH
${
isAuth
}
`
);
/* eslint-disable no-nested-ternary */
return
typeof
isAuth
===
null
||
role
===
null
?
(
return
typeof
isAuth
===
null
&&
role
===
null
?
(
<
BlurCircular
/>
)
:
// props comes afterwards so the can override the default ones.
allowedRoles
.
includes
(
role
)
&&
isAuth
?
(
Loading