Skip to content

Commit

Permalink
fix(web-ux): remove login services
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomgrus authored and Vincent59 committed Mar 18, 2022
1 parent 1a23783 commit 417110c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 398 deletions.
20 changes: 20 additions & 0 deletions code/web-ux/.releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"branches": [
{"name": "main"}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@semantic-release/exec", {
"verifyConditionsCmd": "git pull"
}],
"@semantic-release/npm",
["@semantic-release/git", {
"assets": ["package.json"],
"message": "chore(web-ux): ara-web-ux ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}]
],
"extends": [
"semantic-release-monorepo"
]
}
115 changes: 0 additions & 115 deletions code/web-ux/src/components/loginForm.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
<script>
import Mgr from "../services/SecurityService";
import Api from "../services/ApiService";
export default {
data: () => {
return {
mgr: new Mgr(),
api: new Api(),
userData: false,
errorMessage: "",
user: {
Expand All @@ -15,115 +10,6 @@ export default {
},
};
},
methods: {
async getAll(api) {
let self = this;
let result = await this.api.getAll(api);
self.logApi(result);
},
getToken() {
let self = this;
this.mgr.getUser().then(
(token) => {
self.logToken(token);
},
(err) => {
console.log(err);
}
);
},
getTokenId() {
let self = this;
this.mgr.getIdToken().then(
(tokenId) => {
self.logToken(tokenId);
},
(err) => {
console.log(err);
}
);
},
getTokenSessionState() {
let self = this;
this.mgr.getSessionState().then(
(sessionState) => {
self.logToken(sessionState);
},
(err) => {
console.log(err);
}
);
},
getAccessToken() {
let self = this;
this.mgr.getAcessToken().then(
(acessToken) => {
self.logToken(acessToken);
},
(err) => {
console.log(err);
}
);
},
getTokenScopes() {
let self = this;
this.mgr.getScopes().then(
(scopes) => {
self.logToken(scopes);
},
(err) => {
console.log(err);
}
);
},
getTokenProfile() {
let self = this;
this.mgr.getProfile().then(
(tokenProfile) => {
self.logToken(tokenProfile);
},
(err) => {
console.log(err);
}
);
},
renewToken() {
let self = this;
this.mgr.renewToken().then(
(newToken) => {
self.logToken(newToken);
},
(err) => {
console.log(err);
}
);
},
logApi() {
document.getElementById("resultsApi").innerText = "";
Array.prototype.forEach.call(arguments, function (msg) {
if (msg instanceof Error) {
msg = "Error: " + msg.message;
} else if (typeof msg !== "string") {
msg = JSON.stringify(msg, null, 2);
}
document.getElementById("resultsApi").innerHTML += msg + "\r\n";
});
},
logToken() {
document.getElementById("resultsToken").innerText = "";
Array.prototype.forEach.call(arguments, function (msg) {
if (msg instanceof Error) {
msg = "Error: " + msg.message;
} else if (typeof msg !== "string") {
msg = JSON.stringify(msg, null, 2);
}
document.getElementById("resultsToken").innerHTML += msg + "\r\n";
});
},
},
};
</script>

Expand Down Expand Up @@ -186,7 +72,6 @@ export default {
<div style="width: 400px; display: flex; justify-content: center">
<button
class="vtmn-btn vtmn-btn_variant--primary vtmn-btn_size--medium"
@click="getAll('values')"
>
Sign in
</button>
Expand Down
23 changes: 0 additions & 23 deletions code/web-ux/src/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { createApp } from "vue";
import router from "./router";
import App from "./App.vue";
import Mgr from "./services/SecurityService";

// GLOBAL CSS FILE
import "./assets/css/global.css";
Expand All @@ -24,25 +23,3 @@ const app = createApp(App);
app.use(router);

app.mount("#app");

let mgr = new Mgr();

router.beforeEach((to, from, next) => {
const requiresAuth = to.matched.some((record) => record.meta.requiresAuth);
if (requiresAuth) {
mgr.getRole().then(
(sucess) => {
if (to.meta.role == sucess) {
next();
} else {
next("/accessdenied");
}
},
(err) => {
console.log(err);
}
);
} else {
next();
}
});
Loading

0 comments on commit 417110c

Please sign in to comment.