Skip to content
This repository was archived by the owner on Mar 12, 2020. It is now read-only.

check if session is valid before cache#80

Open
PhilWaldmann wants to merge 1 commit intoamazon-archives:masterfrom
PhilWaldmann:getTokenQueryParameter-fix
Open

check if session is valid before cache#80
PhilWaldmann wants to merge 1 commit intoamazon-archives:masterfrom
PhilWaldmann:getTokenQueryParameter-fix

Conversation

@PhilWaldmann
Copy link
Copy Markdown

calling parseCognitoWebResponse(window.location.href) (like in the sample) will throw an error if the url does contain any arbitrary fragment (e.g. https://domain.com/signin-callback.html#foo)

aws-cognito-sdk.js:11656 Uncaught TypeError: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.
    at fromObject (aws-cognito-sdk.js:11656)
    at from (aws-cognito-sdk.js:11505)
    at new Buffer (aws-cognito-sdk.js:11482)
    at Object.decode64 [as decode] (aws-cognito-sdk.js:7825)
    at CognitoAccessToken.getUsername (amazon-cognito-auth.js:221)
    at CognitoAuth.cacheTokensScopes (amazon-cognito-auth.js:1267)
    at CognitoAuth.getTokenQueryParameter (amazon-cognito-auth.js:1198)
    at CognitoAuth.parseCognitoWebResponse (amazon-cognito-auth.js:1136)
    at (index):40

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant