Skip to content

Commit

Permalink
Merge pull request #48 from daystram/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
daystram authored Jul 12, 2021
2 parents 0a9ea14 + 2a55fd3 commit 68963fe
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 187 deletions.
183 changes: 0 additions & 183 deletions ..gitlab-ci.yml

This file was deleted.

13 changes: 13 additions & 0 deletions ratify-fe/src/utils/url.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export function validateURL(
urlString: string,
allowInsecure?: boolean,
allowLocalhost?: boolean
): boolean {
const url = new URL(urlString);
return (
((url.protocol === "http:" && allowInsecure) ||
url.protocol === "https:") &&
(url.hostname !== "localhost" || !!allowLocalhost) &&
url.origin !== null
);
}
9 changes: 5 additions & 4 deletions ratify-fe/src/views/manage/application/ApplicationList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@
import Vue from "vue";
import api from "@/apis/api";
import { STATUS } from "@/constants/status";
import { maxLength, required, url } from "vuelidate/lib/validators";
import { validateURL } from "@/utils/url";
import { maxLength, required } from "vuelidate/lib/validators";
export default Vue.extend({
data: () => ({
Expand Down Expand Up @@ -341,9 +342,9 @@ export default Vue.extend({
create: {
name: { required, maxLength: maxLength(20) },
description: { required, maxLength: maxLength(50) },
loginURL: { required, url },
callbackURL: { required, url },
logoutURL: { required, url }
loginURL: { required, url: validateURL },
callbackURL: { required, url: validateURL },
logoutURL: { required, url: validateURL }
}
},
Expand Down

0 comments on commit 68963fe

Please sign in to comment.