Access Token is too long

We have a website that has a requirement to use KakaoTalk to share an image. After using the login API and getting the access token from redirect URI, we get this error:
image

this is how I get the access token from the redirect URI

let sParam = "code";
let sPageURL = window.location.search.substring(1),
  sURLVariables = sPageURL.split("&"),
  sParameterName,
  i;
let authObj = null;
for (i = 0; i < sURLVariables.length; i++) {
  sParameterName = sURLVariables[i].split("=");
  if (sParameterName[0] === sParam) {
    authObj =
      sParameterName[1] === undefined
        ? true
        : decodeURIComponent(sParameterName[1]);
  }
}

Kakao.Auth.setAccessToken(authObj);
console.log(Kakao.Auth.getAccessToken())

I would also like to point out I dont speak korean. But google translate kinda works to some extent.

This error occured because you have input an authorization code in Kakao.Auth.setAccessToken() instead of an access token.
Please see this guide for better understanding the difference between an authorization code and an access token.
https://developers.kakao.com/docs/latest/en/kakaologin/common#login