passport-osu-web
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

passport-osu

A simple Strategy for Passport authentication with osu! V2. TypeScript Definitions are Included for Code-Completion.

import {OsuStrategy, OsuStrategyOptions} from 'passport-osu'
passport.use(new OsuStrategy(new OsuStrategyOptions({
    clientID: "--ID--",
    clientSecret: "--SECRET--",
    callbackURL: "http://localhost:3000/auth/osu/callback"
  }),
  function(accessToken, refreshToken, profile, done) {
    // placeholder for translating profile into your own custom user object.
    // for now we will just use the profile object returned by GitHub
    return done(null, profile);
  }
));
 
// we will call this to start the GitHub Login process
app.get('/auth/osu', passport.authenticate('osu'));
 
// Osu will call this URL
app.get('/auth/osu/callback',
  passport.authenticate('osu', { failureRedirect: '/' }),
  function(req, res) {
    res.redirect('/');
  });

Dependencies (4)

Dev Dependencies (5)

Package Sidebar

Install

npm i passport-osu-web

Weekly Downloads

1

Version

1.0.7

License

ISC

Unpacked Size

33 kB

Total Files

13

Last publish

Collaborators

  • gabrieltk