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