Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Frontend-MECRED
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
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
MECRED
Frontend-MECRED
Commits
77b80b05
Commit
77b80b05
authored
2 months ago
by
jsk22
Browse files
Options
Downloads
Patches
Plain Diff
login working
parent
b7b1f32a
No related branches found
No related tags found
1 merge request
!294
Issue/271.1 create new backend routes connection
Pipeline
#42187
passed
2 months ago
Stage: build
Changes
3
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/app/components/Notifications.js
+3
-3
3 additions, 3 deletions
src/app/components/Notifications.js
src/app/handlers/loginHandler.js
+2
-2
2 additions, 2 deletions
src/app/handlers/loginHandler.js
src/app/perfil/[id]/components/UserCard.js
+3
-2
3 additions, 2 deletions
src/app/perfil/[id]/components/UserCard.js
with
8 additions
and
7 deletions
src/app/components/Notifications.js
+
3
−
3
View file @
77b80b05
import
mecredApi
from
"
@/axiosConfig
"
;
import
mecredApi
from
"
@/axiosConfig
"
;
import
{
authHeaders
,
useLoginBarrier
}
from
"
@/app/handlers/loginHandler
"
;
import
{
authHeaders
,
useLoggedIn
,
useLoginBarrier
}
from
"
@/app/handlers/loginHandler
"
;
import
{
getStoredValue
}
from
"
@/app/handlers/localStorageHandler
"
;
import
{
getStoredValue
}
from
"
@/app/handlers/localStorageHandler
"
;
import
{
useEffect
,
useState
}
from
'
react
'
import
{
useEffect
,
useState
}
from
'
react
'
import
ModalNotifications
from
"
./ModalNotifications
"
;
import
ModalNotifications
from
"
./ModalNotifications
"
;
...
@@ -9,9 +9,9 @@ export default function Notifications({id}) {
...
@@ -9,9 +9,9 @@ export default function Notifications({id}) {
const
[
countNotifications
,
setCountNotifications
]
=
useState
(
null
);
const
[
countNotifications
,
setCountNotifications
]
=
useState
(
null
);
const
loginBarrier
=
useLoginBarrier
()
const
loginBarrier
=
useLoginBarrier
()
const
loggedIn
=
useLoggedIn
()
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
!
log
inBarrier
()
)
if
(
!
log
gedIn
)
return
return
const
getNotifications
=
async
()
=>
{
const
getNotifications
=
async
()
=>
{
await
mecredApi
await
mecredApi
...
...
This diff is collapsed.
Click to expand it.
src/app/handlers/loginHandler.js
+
2
−
2
View file @
77b80b05
...
@@ -16,7 +16,7 @@ export function useLoginBarrier() {
...
@@ -16,7 +16,7 @@ export function useLoginBarrier() {
const
router
=
useRouter
();
const
router
=
useRouter
();
return
useCallback
(()
=>
{
return
useCallback
(()
=>
{
if
(
!
localStorage
.
getItem
(
'
token
'
))
return
true
;
if
(
localStorage
.
getItem
(
'
token
'
))
return
true
;
const
params
=
new
URLSearchParams
();
const
params
=
new
URLSearchParams
();
params
.
set
(
"
redirect
"
,
pathname
);
params
.
set
(
"
redirect
"
,
pathname
);
...
...
This diff is collapsed.
Click to expand it.
src/app/perfil/[id]/components/UserCard.js
+
3
−
2
View file @
77b80b05
...
@@ -7,7 +7,7 @@ import { Avatar } from '@mui/material';
...
@@ -7,7 +7,7 @@ import { Avatar } from '@mui/material';
import
{
useEffect
,
useState
}
from
'
react
'
;
import
{
useEffect
,
useState
}
from
'
react
'
;
import
{
getStoredValue
}
from
'
@/app/handlers/localStorageHandler
'
;
import
{
getStoredValue
}
from
'
@/app/handlers/localStorageHandler
'
;
import
mecredApi
,
{
mecredURL
}
from
'
@/axiosConfig
'
;
import
mecredApi
,
{
mecredURL
}
from
'
@/axiosConfig
'
;
import
{
authHeaders
,
isLoggedIn
,
userData
}
from
'
@/app/handlers/loginHandler
'
;
import
{
authHeaders
,
isLoggedIn
,
useLoggedIn
,
userData
}
from
'
@/app/handlers/loginHandler
'
;
import
Stats
from
'
./Stats
'
;
import
Stats
from
'
./Stats
'
;
import
MedalAchievements
from
'
./MedalAchievements
'
;
import
MedalAchievements
from
'
./MedalAchievements
'
;
import
AboutCard
from
"
./AboutCard
"
;
import
AboutCard
from
"
./AboutCard
"
;
...
@@ -108,12 +108,13 @@ export default function UserCard({ profileData, idLogin, achievements, progresse
...
@@ -108,12 +108,13 @@ export default function UserCard({ profileData, idLogin, achievements, progresse
const
[
medalActive
,
setMedalActive
]
=
useState
(
0
)
const
[
medalActive
,
setMedalActive
]
=
useState
(
0
)
const
[
profileInfo
,
setProfileInfo
]
=
useState
(
""
)
const
[
profileInfo
,
setProfileInfo
]
=
useState
(
""
)
const
loggedIn
=
useLoggedIn
()
/**
/**
* faz fetch dos seguidores e seguindo, se não estiver logado não aparece essa informação
* faz fetch dos seguidores e seguindo, se não estiver logado não aparece essa informação
*/
*/
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
!
isL
oggedIn
)
if
(
!
l
oggedIn
)
return
;
return
;
setProfileInfo
(
userData
()[
"
user
"
])
setProfileInfo
(
userData
()[
"
user
"
])
console
.
log
(
profileData
)
console
.
log
(
profileData
)
...
...
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