mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
17 lines
432 B
TypeScript
17 lines
432 B
TypeScript
import * as discourseSSO from 'discourse-sso';
|
|
const sso = new discourseSSO('sso secret string');
|
|
|
|
if (sso.validate('payload', 'sig')) {
|
|
const nonce = sso.getNonce('payload');
|
|
|
|
const userParams: discourseSSO.UserParams = {
|
|
nonce,
|
|
external_id: '1',
|
|
email: 'omg@mail.com',
|
|
username: 'myuser',
|
|
name: 'This Guy'
|
|
};
|
|
|
|
const loginString: string = sso.buildLoginString(userParams);
|
|
}
|