Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
SigNoz
Commits
c8b92ce4
Commit
c8b92ce4
authored
4 years ago
by
dhrubesh-makeen
Browse files
Options
Download
Email Patches
Plain Diff
removes hardcoding--2
parent
d5cb1912
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
frontend/src/constants/auth.ts
+1
-0
frontend/src/constants/auth.ts
frontend/src/modules/AppWrapper.tsx
+2
-1
frontend/src/modules/AppWrapper.tsx
frontend/src/modules/Auth/Signup.tsx
+2
-3
frontend/src/modules/Auth/Signup.tsx
with
5 additions
and
4 deletions
+5
-4
frontend/src/constants/auth.ts
0 → 100644
+
1
-
0
View file @
c8b92ce4
export
const
IS_LOGGED_IN
=
"
isLoggedIn
"
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
frontend/src/modules/AppWrapper.tsx
+
2
-
1
View file @
c8b92ce4
...
...
@@ -2,6 +2,7 @@ import React, { Suspense } from "react";
import
{
Layout
,
Spin
}
from
"
antd
"
;
import
{
useThemeSwitcher
}
from
"
react-css-theme-switcher
"
;
import
ROUTES
from
"
Src/constants/routes
"
;
import
{
IS_LOGGED_IN
}
from
"
Src/constants/auth
"
;
import
{
BrowserRouter
as
Router
,
Route
,
...
...
@@ -58,7 +59,7 @@ const App = () => {
path
=
"/"
exact
render
=
{
()
=>
{
return
localStorage
.
getItem
(
"
isLoggedIn
"
)
===
"
yes
"
?
(
return
localStorage
.
getItem
(
IS_LOGGED_IN
)
===
"
yes
"
?
(
<
Redirect
to
=
{
ROUTES
.
APPLICATION
}
/>
)
:
(
<
Redirect
to
=
{
ROUTES
.
SIGN_UP
}
/>
...
...
This diff is collapsed.
Click to expand it.
frontend/src/modules/Auth/Signup.tsx
+
2
-
3
View file @
c8b92ce4
...
...
@@ -2,6 +2,7 @@ import React, { useState } from "react";
import
{
Row
,
Space
,
Button
,
Input
}
from
"
antd
"
;
import
api
,
{
apiV1
}
from
"
../../api
"
;
import
ROUTES
from
"
Src/constants/routes
"
;
import
{
IS_LOGGED_IN
}
from
"
Src/constants/auth
"
;
import
{
withRouter
}
from
"
react-router
"
;
import
{
RouteComponentProps
}
from
"
react-router-dom
"
;
...
...
@@ -36,8 +37,6 @@ const Signup = (props: SignUpProps) => {
const
handleSubmit
=
(
e
:
any
)
=>
{
e
.
preventDefault
();
console
.
log
(
"
in handle submit
"
);
setState
({
...
state
,
submitted
:
true
});
const
payload
=
{
...
...
@@ -52,7 +51,7 @@ const Signup = (props: SignUpProps) => {
console
.
log
(
res
.
data
);
});
localStorage
.
setItem
(
"
isLoggedIn
"
,
"
yes
"
);
localStorage
.
setItem
(
IS_LOGGED_IN
,
"
yes
"
);
props
.
history
.
push
(
ROUTES
.
APPLICATION
);
};
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment