Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK for QR Code Based Authentication Project. #3

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

Isurika1998
Copy link
Contributor

Purpose

Implement the SDK for the QR Code Based Authentication project.

Related Issue : wso2/product-is#12833

authResponse: authResponse
};

const authUrl = "https://192.168.1.3:9443/qr-auth/authenticate";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The server URL should be configurable.

@Isurika1998 Isurika1998 marked this pull request as ready for review April 27, 2022 15:58
samples/sample-mobile-app/sdk/README.md Outdated Show resolved Hide resolved
samples/sample-mobile-app/sdk/README.md Outdated Show resolved Hide resolved
samples/sample-mobile-app/sdk/README.md Outdated Show resolved Hide resolved
Comment on lines 39 to 46
if (sessionDataKey) {
authRequest = {
sessionDataKey: sessionDataKey,
tenantDomain: tenantDomain,
};
} else {
throw new Error("One or more required parameters (tenantDomain, sessionDataKey) was not found.");
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's fix the indentation here.


return result.then((res) => {
let result;
if (res.status === 202 && response == "SUCCESSFUL") {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better if string literals like SUCCESSFUL can be moved to enums.

Comment on lines 37 to 42
date:
current.getDate() +
"-" +
current.getMonth() +
"-" +
current.getFullYear(),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 43 to 51
time:
(current.getHours() < 12
? current.getHours()
: current.getHours() - 12) +
":" +
current.getMinutes() +
(current.getHours() < 12)
? " a.m."
: " p.m."
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return response;
})
.catch((err: any) => {
console.log(`error: ${err.status}`);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use the logger here.

body: body
})
.then((response: any) => {

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants