passport-osuv2
v1.0.0
Published
Passport Auth Implementation for osu!-web Api (v2.0)
Downloads
3
Readme
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('/');
});