Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@edcademy/imgur-auth

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@edcademy/imgur-auth

A simple code snippet for authenticating using imgur api

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Steps to use this snippet

  1. Run requestAccessToken function either by importing it from this utility or using the window.requestAccessToken in your browser console passing your clientId you obtained from imgur to it.
    It will redirect user to the imgur and authenticate them.
window.requestAccessToken(myClientId);
  1. Upon finishing authentication, imgur will redirect users back to your application. please make sure you have correct redirectUrl set in the imgur configs. Go to this link: (https://imgur.com/account/settings/apps)[https://imgur.com/account/settings/apps] and click on edit beneath the redirect column. set your redirect url to something like: http://localhost:3000/oauth-callback
  2. import OAuthCallback from this package and mount it on the endpoint you've set in the previous step. The following snippet is for the url in previous step:
<Route path="/oauth-callback" exact element={<OAuthCallback />} />
  1. (Optional) You can pass callbacks to OAuthCallback to navigate user away upon finishing authentication:
<Route
  path="/oauth-callback"
  exact
  element={
    <OAuthCallback onAuthenticationSucceed={() => history.replace('/')} />
  }
/>

FAQs

Package last updated on 30 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc