Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login Session #21

Closed
nnivxix opened this issue May 11, 2024 · 0 comments · Fixed by #25 or #27
Closed

Login Session #21

nnivxix opened this issue May 11, 2024 · 0 comments · Fixed by #25 or #27

Comments

@nnivxix
Copy link
Owner

nnivxix commented May 11, 2024

  1. Create a new request token
  2. Get the user to authorize the request token
  3. Create a new session id with the athorized request token
  • [GET] https://www.themoviedb.org/authenticate/{REQUEST_TOKEN}

  • Generate Session Id with body param request token in step 2

    {"request_token":"68bd8789bfe7d3bc9bbaa6af8b3fca39bb9d3269"}
    const fetch = require('node-fetch');
    const url = 'https://api.themoviedb.org/3/authentication/session/new';
    const options = {
      method: 'POST',
      headers: {
        accept: 'application/json',
        'content-type': 'application/json',
        Authorization: 'Bearer ${API_AUTH_TOKEN}'
      },
        body: JSON.stringify({request_token: '68bd8789bfe7d3bc9bbaa6af8b3fca39bb9d3269'})
      };
    
     fetch(url, options)
      .then(res => res.json())
      .then(json => console.log(json))
      .catch(err => console.error('error:' + err));
@nnivxix nnivxix linked a pull request May 19, 2024 that will close this issue
@nnivxix nnivxix mentioned this issue May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant