Code Monkey home page Code Monkey logo

Comments (5)

VarunMohan avatar VarunMohan commented on July 2, 2024

Question, was the browser opened automatically or did you paste the link into your browser?

from codeium.vim.

Alexis12119 avatar Alexis12119 commented on July 2, 2024

The browser didn't automatically opened and I used the link that was prompted to me so It's latest.

from codeium.vim.

TheLeoP avatar TheLeoP commented on July 2, 2024

The problem is that the link isn'r formated corectly. As the screenshot shows, The link ends at Guid, then it shows ---- in a new line and half of the link ad the next line e874.... If you open the browser with the link like ...e874... (without the Guid and withouth ---- in the middle), it works as expected

Edit: the problem is that the output from the command used on Windows to get the guid looks like the following

Guid
----
some-guid-here-

That's why the formatting gets messed up

Edit again: the following code resolves this issue

function! s:Uuid() abort
  if has('win32')
    return system('powershell -Command "[guid]::NewGuid().Guid"')
  elseif executable('uuidgen')
    return system('uuidgen')
  endif

  throw 'Could not generate uuid. Please make sure uuidgen is installed.'
endfunction

[guid]::NewGuid() has been changed to [guid]::NewGuid().Guid

Edit 3: changing the following code results in the browser automatically opening the url

    try
      call system(browser . ' ' . '"' . url . '"')
      if v:shell_error is# 0
        let opened_browser = v:true
      endif
    catch
    endtry

The single quotes that where supposed to surround url were changed to double quotes. I'm not sure whether this causes issues on Linux or Mac.

Edit 4: despite all of this working, when I paste the received token inside Neovim, it complains about he token not being valid

Edit 5: I manage to get this working, the problem were the double and single quotes again. Using the following code to register a user works.

    let command = 'curl -s https://api.codeium.com/register_user/ ' .
          \ '--header "Content-Type: application/json" ' .
          \ '--data ' . '"' . json_encode({'firebase_id_token': auth_token})->substitute('"', '\\"', 'g') . '"'

from codeium.vim.

pqn avatar pqn commented on July 2, 2024

@TheLeoP thanks for the investigation, would be awesome if you wanted to open a PR with these fixes.

from codeium.vim.

chrissound avatar chrissound commented on July 2, 2024

If for any reason an invalid link is generated the website should mention this and not show a half functioning copy token page.. Should be reported upstream somewhere? I'm running into a similar issue where my generated url is https://www.codeium.com/profile?response_type=token&redirect_uri=vim-show-auth-token&state=

from codeium.vim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.