Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SSHOC
sshoc-marketplace-frontend
Commits
66e4317a
Commit
66e4317a
authored
Jun 30, 2021
by
Stefan Probst
Browse files
fix: fix token length check for sign in as well
parent
9c49e748
Pipeline
#208121
passed with stages
in 11 minutes and 59 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/screens/auth/SignInScreen.tsx
View file @
66e4317a
...
...
@@ -175,7 +175,11 @@ function useValidateToken() {
const
url
=
createUrlFromPath
(
router
.
asPath
)
const
{
hash
,
searchParams
}
=
url
if
(
hash
&&
hash
.
length
===
69
)
{
/**
* The develop egi instance uses 68+1 chars, the demo instance (which is used on staging)
* uses 64+1 chars.
*/
if
(
hash
&&
(
hash
.
length
===
69
||
hash
.
length
===
65
))
{
/** remove leading "#" character */
const
authCode
=
hash
.
slice
(
1
)
validateToken
([{
token
:
authCode
,
registration
:
false
}],
{
...
...
@@ -209,6 +213,9 @@ function useValidateToken() {
shallow
:
true
,
},
)
}
else
{
toast
.
error
(
'
Received invalid token.
'
)
router
.
replace
({
pathname
:
'
/auth/sign-in
'
})
}
},
[
router
,
auth
,
validateToken
,
status
])
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment