Skip to content

Commit

Permalink
rename signin
Browse files Browse the repository at this point in the history
  • Loading branch information
huangjoyce3 committed Sep 26, 2019
1 parent 3f226d9 commit 868e6c9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion dist/appid.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/appid.umd.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions sample/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
<script type='text/javascript' src="appid.min.js"></script>
<script>
function showError(e) {
console.error(e);
document.getElementById('error').textContent = e;
document.getElementById('login').setAttribute('class', 'button');
console.error(e);
document.getElementById('error').textContent = e;
document.getElementById('login').setAttribute('class', 'button');
}

(async function () {
Expand All @@ -57,7 +57,7 @@
document.getElementById('error').textContent = '';

try {
const tokens = await appID.signinWithPopup();
const tokens = await appID.signin();
let userInfo = await appID.getUserInfo(tokens.accessToken);
let decodeIDToken = tokens.idTokenPayload;
document.getElementById('welcome').textContent = 'Hello, ' + decodeIDToken.name;
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class AppID {
* @throws OAuthError - Any errors from the server. e.g. {error: 'server_error', description: ''}
* @throws RequestError - Any errors during a HTTP request.
*/
async signinWithPopup() {
async signin() {
const {codeVerifier, nonce, state, authUrl} = this.utils.getAuthParams(this.clientId, this.window.origin);

this.popup.open(this.popupConfig);
Expand Down
6 changes: 3 additions & 3 deletions test/AppIdTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('AppID tests', () => {
w: {origin: 'http://localhost:3005'},
url: URL
});
let res = await appID.signinWithPopup();
let res = await appID.signin();
assert.equal(res.accessToken, 'accessToken');
assert.equal(res.idToken, 'idToken');
assert.equal(res.accessTokenPayload, 'tokenPayload');
Expand All @@ -40,7 +40,7 @@ describe('AppID tests', () => {
url: URL
});
try {
await appID.signinWithPopup();
await appID.signin();
} catch (e) {
assert.equal(e.description, constants.INVALID_STATE);
}
Expand All @@ -58,7 +58,7 @@ describe('AppID tests', () => {
url: URL
});
try {
await appID.signinWithPopup();
await appID.signin();
} catch (e) {
assert.equal(e.error, 'access_denied');
assert.equal(e.description, 'Could not verify SAML assertion');
Expand Down

0 comments on commit 868e6c9

Please sign in to comment.