urls for otp
This commit is contained in:
parent
c77d280b00
commit
0a980fd560
|
@ -706,7 +706,7 @@
|
|||
*/
|
||||
return OAUTH3._browser.request(preq, opts);
|
||||
}
|
||||
, implicitGrant: function(directives, opts) {
|
||||
, implicitGrant: function (directives, opts) {
|
||||
var promise;
|
||||
var providerUri = directives.azp || directives.issuer || directives;
|
||||
|
||||
|
|
|
@ -287,21 +287,25 @@ OAUTH3.urls.publishKey = function (directive, opts) {
|
|||
, session: opts.session
|
||||
};
|
||||
};
|
||||
OAUTH3.urls.credentialMeta = function (directive, opts) {
|
||||
return OAUTH3.url.resolve(directive.api, directive.credential_meta.url)
|
||||
.replace(':type', 'email')
|
||||
.replace(':id', opts.email)
|
||||
};
|
||||
|
||||
OAUTH3.authn = {};
|
||||
OAUTH3.authn.loginMeta = function (directive, opts) {
|
||||
var url = OAUTH3.urls.credentialMeta(directive, opts);
|
||||
return OAUTH3.request({
|
||||
method: directive.credential_meta.method || 'GET'
|
||||
// TODO lint urls
|
||||
// TODO client_uri
|
||||
, url: OAUTH3.url.resolve(directive.api, directive.credential_meta.url)
|
||||
.replace(':type', 'email')
|
||||
.replace(':id', opts.email)
|
||||
, url: url
|
||||
});
|
||||
};
|
||||
OAUTH3.authn.otp = function (directive, opts) {
|
||||
OAUTH3.urls.otp = function (directive, opts) {
|
||||
// TODO client_uri
|
||||
var preq = {
|
||||
return {
|
||||
method: directive.credential_otp.method || 'POST'
|
||||
, url: OAUTH3.url.resolve(directive.api, directive.credential_otp.url)
|
||||
, data: {
|
||||
|
@ -314,6 +318,9 @@ OAUTH3.authn.otp = function (directive, opts) {
|
|||
, username: opts.email
|
||||
}
|
||||
};
|
||||
};
|
||||
OAUTH3.authn.otp = function (directive, opts) {
|
||||
var preq = OAUTH3.urls.otp(directive, opts);
|
||||
|
||||
return OAUTH3.request(preq);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue