Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
declare module 'discord-auth' {
export default class Strategy {
/**
* `Strategy` constructor.
*
* The Discord authentication strategy authenticates requests by delegating to
* Discord via the OAuth2.0 protocol
*
* Applications must supply a `verify` callback which accepts an `accessToken`,
* `refreshToken` and service-specific `profile`, and then calls the `cb`
* callback supplying a `user`, which should be set to `false` if the
* credentials are not valid. If an exception occured, `err` should be set.
*
* Options:
* - `clientID` OAuth ID to discord
* - `clientSecret` OAuth Secret to verify client to discord
* - `callbackURL` URL that discord will redirect to after auth
* - `scope` Array of permission scopes to request
* Check the official documentation for valid scopes to pass as an array.
*/
constructor(options: {
clientID: string,
clientSecret: string,
callbackURL: string,
scope?: string | string[];
}, verify: (accessToken: string, refreshToken: string, profile: string, cb: (err: Error, user?: object) => void) => void)
}
}
59 changes: 30 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
{
"name": "discord-auth",
"version": "1.0.0",
"description": "Simple Discord OAuth client for making dashboard and website linked with discord.",
"main": "lib/index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/IamTheRealSami/discord-auth.git"
},
"keywords": [
"passport",
"discord",
"auth",
"authentication",
"authn",
"identity",
"discord-auth",
"discord-oauth",
"discordapp"
],
"author": "IamTheRealSami",
"license": "ISC",
"bugs": {
"url": "https://github.com/IamTheRealSami/discord-auth/issues"
},
"homepage": "https://github.com/IamTheRealSami/discord-auth#readme",
"dependencies": {
"passport-oauth2": "^1.5.0"
}
}
"name": "discord-auth",
"version": "1.0.0",
"description": "Simple Discord OAuth client for making dashboard and website linked with discord.",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/IamTheRealSami/discord-auth.git"
},
"keywords": [
"passport",
"discord",
"auth",
"authentication",
"authn",
"identity",
"discord-auth",
"discord-oauth",
"discordapp"
],
"author": "IamTheRealSami",
"license": "ISC",
"bugs": {
"url": "https://github.com/IamTheRealSami/discord-auth/issues"
},
"homepage": "https://github.com/IamTheRealSami/discord-auth#readme",
"dependencies": {
"passport-oauth2": "^1.5.0"
}
}