Commit ffcfdbb0 authored by Stefan Probst's avatar Stefan Probst
Browse files

fix: fix token length check

parent b2e900c6
Pipeline #208162 passed with stages
in 10 minutes and 42 seconds
......@@ -176,10 +176,10 @@ function useValidateToken() {
const url = createUrlFromPath(router.asPath)
const { hash, searchParams } = url
/**
* The develop egi instance uses 68+1 chars, the demo instance (which is used on staging)
* uses 64+1 chars.
* Hash is base64 encoded token generated by *our* api here:
* https://gitlab.gwdg.de/sshoc/sshoc-marketplace-backend/-/blob/develop/src/main/java/eu/sshopencloud/marketplace/conf/auth/ImplicitGrantTokenProvider.java#L25
*/
if (hash && (hash.length === 69 || hash.length === 65)) {
if (hash && hash.length > 0) {
/** remove leading "#" character */
const authCode = hash.slice(1)
validateToken([{ token: authCode, registration: false }], {
......
......@@ -204,10 +204,10 @@ function useValidateAuthCode() {
const url = createUrlFromPath(router.asPath)
const { hash } = url
/**
* The develop egi instance uses 68+1 chars, the demo instance (which is used on staging)
* uses 64+1 chars.
* Hash is base64 encoded token generated by *our* api here:
* https://gitlab.gwdg.de/sshoc/sshoc-marketplace-backend/-/blob/develop/src/main/java/eu/sshopencloud/marketplace/conf/auth/ImplicitGrantTokenProvider.java#L25
*/
if (hash && (hash.length === 69 || hash.length === 65)) {
if (hash && hash.length > 0) {
/** remove leading "#" character */
const authCode = hash.slice(1)
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment