Skip to content

Commit

Permalink
Merge branch 'master' into feat/whitelabel
Browse files Browse the repository at this point in the history
  • Loading branch information
BboyStatix committed Jan 4, 2024
2 parents 1c25b86 + 53fdf94 commit 70e3d80
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 155 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:

steps:
- name: Check out Git repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: "npm"
Expand All @@ -43,7 +43,7 @@ jobs:
# Set the credentials from repository settings/secrets
- name: Configure AWS credentials
if: github.ref == 'refs/heads/master'
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"node-option": ["experimental-specifier-resolution=node", "loader=ts-node/esm/transpile-only"],
"node-option": ["experimental-specifier-resolution=node"],
"extension": ["ts", "js"],
"require": ["../../test/setup.mjs"],
"timeout": 0,
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"editor.codeActionsOnSave": {
"source.fixAll": true
"source.fixAll": "explicit"
},
"eslint.workingDirectories": [
{
Expand Down
16 changes: 14 additions & 2 deletions examples/vue-example/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,12 @@ body,
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);

background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
background-position: calc(100% - 20px) calc(1px + 50%), calc(100% - 16px) calc(1px + 50%);
background-size: 4px 4px, 4px 4px;
background-position:
calc(100% - 20px) calc(1px + 50%),
calc(100% - 16px) calc(1px + 50%);
background-size:
4px 4px,
4px 4px;
background-repeat: no-repeat;
}

Expand Down Expand Up @@ -379,3 +383,11 @@ body,
margin-top: 24px;
margin-bottom: -16px;
}

.mfa {
display: flex;
align-items: center;
column-gap: 16px;
margin-top: 24px;
margin-bottom: -16px;
}
21 changes: 21 additions & 0 deletions examples/vue-example/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
<label for="mpc">Enable MPC</label>
<input type="checkbox" id="mpc" name="mpc" v-model="useMpc" />
</div>
<div class="mfa">
<label for="mfa">Enable All MFA Factors</label>
<input type="checkbox" id="mfa" name="mfa" v-model="enableAllFactors" />
</div>
<select v-model="selectedBuildEnv" class="select">
<option :key="login" v-for="login in Object.values(BUILD_ENV)" :value="login">{{ login }}</option>
</select>
Expand Down Expand Up @@ -154,6 +158,7 @@ export default defineComponent({
data() {
return {
loading: false,
enableAllFactors: false,
privKey: "",
ethereumPrivateKeyProvider: null as EthereumPrivateKeyProvider | EthMpcPrivKeyProvider | null,
LOGIN_PROVIDER: LOGIN_PROVIDER,
Expand Down Expand Up @@ -212,6 +217,14 @@ export default defineComponent({
useMpc: this.useMpc,
buildEnv: this.selectedBuildEnv,
// sdkUrl: "https://staging.openlogin.com",
mfaSettings: this.enableAllFactors
? {
backUpShareFactor: { enable: true },
deviceShareFactor: { enable: true },
passwordFactor: { enable: true },
socialBackupFactor: { enable: true },
}
: undefined,
});
op.init();
return op;
Expand All @@ -230,6 +243,14 @@ export default defineComponent({
}
this.openloginInstance.options.uxMode = this.selectedUxMode;
this.openloginInstance.options.whiteLabel = this.isWhiteLabelEnabled ? whitelabel : {};
this.openloginInstance.options.mfaSettings = this.enableAllFactors
? {
backUpShareFactor: { enable: true },
deviceShareFactor: { enable: true },
passwordFactor: { enable: true },
socialBackupFactor: { enable: true },
}
: undefined;
// in popup mode (with third party cookies available) or if user is already logged in this function will
// return priv key , in redirect mode or if third party cookies are blocked then priv key be injected to
// sdk instance after calling init on redirect url page.
Expand Down
132 changes: 0 additions & 132 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"mocha": "^10.2.0",
"prettier": "^3.1.0",
"rimraf": "^5.0.5",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"tslib": "^2.6.2",
Expand Down
13 changes: 7 additions & 6 deletions packages/openlogin/src/OpenLogin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,13 +364,14 @@ class OpenLogin {
window.location.href = loginUrl;
return undefined;
}
return new Promise((resolve, reject) => {
const loginUrl = constructURL({
baseURL: url,
hash: { b64Params: jsonToBase64(configParams) },
});
const currentWindow = new PopupHandler({ url: loginUrl, timeout: popupTimeout });

const loginUrl = constructURL({
baseURL: url,
hash: { b64Params: jsonToBase64(configParams) },
});
const currentWindow = new PopupHandler({ url: loginUrl, timeout: popupTimeout });

return new Promise((resolve, reject) => {
currentWindow.on("close", () => {
reject(LoginError.popupClosed());
});
Expand Down
9 changes: 0 additions & 9 deletions test/setup.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
import Register from "@babel/register";
import path from "path";
import { register } from "ts-node";

register({
project: path.resolve(".", "tsconfig.json"),
require: ["tsconfig-paths/register"],
transpileOnly: true,
compilerOptions: { module: "esnext" },
});

Register({
extensions: [".ts", ".js"],
Expand Down

0 comments on commit 70e3d80

Please sign in to comment.