mirror of
https://github.com/outline/outline.git
synced 2026-11-29 00:29:36 +03:00
refactor
This commit is contained in:
1 parent
9e7dd5b4f7
commit
f71afc2bf5
4 files changed
+6
-11
No files matched your search
@@ -106,10 +106,11 @@ export const OAuthClientForm = observer(function OAuthClientForm_({
|
||||
placeholder="https://example.com/callback"
|
||||
ref={field.ref}
|
||||
value={field.value.join("\n")}
|
||||
rows={Math.max(2, field.value.length)}
|
||||
rows={Math.max(2, field.value.length + 1)}
|
||||
onChange={(event) => {
|
||||
field.onChange(event.target.value.split("\n"));
|
||||
}}
|
||||
required
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
|
||||
@@ -173,6 +173,7 @@ const Application = observer(function Application({ oauthClient }: Props) {
|
||||
<Input
|
||||
type="text"
|
||||
{...register("description", {
|
||||
required: true,
|
||||
maxLength: OAuthClientValidation.maxDescriptionLength,
|
||||
})}
|
||||
flex
|
||||
@@ -276,10 +277,11 @@ const Application = observer(function Application({ oauthClient }: Props) {
|
||||
placeholder="https://example.com/callback"
|
||||
ref={field.ref}
|
||||
value={field.value.join("\n")}
|
||||
rows={Math.max(2, field.value.length)}
|
||||
rows={Math.max(2, field.value.length + 1)}
|
||||
onChange={(event) => {
|
||||
field.onChange(event.target.value.split("\n"));
|
||||
}}
|
||||
required
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
|
||||
@@ -21,14 +21,6 @@ describe("OAuthInterface", () => {
|
||||
);
|
||||
expect(result).toBe(true);
|
||||
});
|
||||
it("should return false for insecure redirect URI", async () => {
|
||||
const redirectUri = "http://example.com/callback";
|
||||
const result = await OAuthInterface.validateRedirectUri(
|
||||
redirectUri,
|
||||
client
|
||||
);
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
it("should return false for invalid redirect URI", async () => {
|
||||
const redirectUri = "invalid_uri";
|
||||
const result = await OAuthInterface.validateRedirectUri(
|
||||
|
||||
@@ -220,7 +220,7 @@ export const OAuthInterface: RefreshTokenModel &
|
||||
return false;
|
||||
}
|
||||
|
||||
return !uri.startsWith("http://");
|
||||
return true;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user