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
Commits
d62e3426
Verified
Commit
d62e3426
authored
3 years ago
by
Defendi Alberto
Browse files
Options
Downloads
Patches
Plain Diff
Nest authuser components route
parent
6b8d2a60
No related branches found
No related tags found
2 merge requests
!56
Refined auth flow and new website pages.
,
!40
Sign up/Log in form nest into AuthUser
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/App.tsx
+2
-1
2 additions, 1 deletion
src/App.tsx
src/components/AuthUser/AuthUser.tsx
+7
-2
7 additions, 2 deletions
src/components/AuthUser/AuthUser.tsx
with
9 additions
and
3 deletions
src/App.tsx
+
2
−
1
View file @
d62e3426
...
...
@@ -9,12 +9,13 @@ import { NotFound } from 'components/NotFound/NotFound';
import
{
ProfilePage
}
from
'
components/ProfilePage/ProfilePage
'
;
import
{
Roles
}
from
'
components/api/userRoles
'
;
import
{
Unauthorized
}
from
'
components/Unauthorized/Unauthorized
'
;
import
{
SignUpForm
}
from
'
components/AuthUser/SignUpForm/SignUpForm
'
;
export
const
App
:
FC
=
()
=>
(
<
Router
>
<
div
data-testid
=
"App"
>
<
Switch
>
<
Route
path
=
{
NonAuthRoutes
.
signIn
}
component
=
{
AuthUser
}
/>
<
Route
path
=
{
NonAuthRoutes
.
auth
}
component
=
{
AuthUser
}
/>
<
Route
exact
path
=
{
NonAuthRoutes
.
home
}
component
=
{
LandingPage
}
/>
<
PrivateRoute
path
=
{
AuthRoutes
.
dashboard
}
...
...
This diff is collapsed.
Click to expand it.
src/components/AuthUser/AuthUser.tsx
+
7
−
2
View file @
d62e3426
import
React
,
{
FC
,
useEffect
}
from
'
react
'
;
import
axios
from
'
axios
'
;
import
Container
from
'
@material-ui/core/Container
'
;
import
{
SignInForm
}
from
'
./SignInForm/SignInForm
'
;
import
{
Route
,
useRouteMatch
}
from
'
react-router-dom
'
;
import
{
NonAuthRoutes
}
from
'
components/api/routes
'
;
import
{
SignInForm
}
from
'
components/AuthUser/SignInForm/SignInForm
'
;
import
{
SignUpForm
}
from
'
components/AuthUser/SignUpForm/SignUpForm
'
;
const
configDjangoCookieName
=
():
void
=>
{
axios
.
defaults
.
xsrfHeaderName
=
'
X-CSRFTOKEN
'
;
...
...
@@ -10,6 +13,7 @@ const configDjangoCookieName = (): void => {
};
export
const
AuthUser
:
FC
=
()
=>
{
const
{
path
}
=
useRouteMatch
();
configDjangoCookieName
();
useEffect
(()
=>
{
axios
...
...
@@ -23,7 +27,8 @@ export const AuthUser: FC = () => {
},
[]);
return
(
<
Container
maxWidth
=
"sm"
>
<
SignInForm
/>
<
Route
path
=
{
`
${
path
}${
NonAuthRoutes
.
signIn
}
`
}
component
=
{
SignInForm
}
/>
<
Route
path
=
{
`
${
path
}${
NonAuthRoutes
.
signUp
}
`
}
component
=
{
SignUpForm
}
/>
</
Container
>
);
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment