-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathOAuth.stories.js
65 lines (51 loc) · 1.73 KB
/
OAuth.stories.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import React from "react";
import OAuthLinkingMessage from "components/oauth/OAuthLinkingMessage";
import OAuthErrorHandler from "../src/components/oauth/OAuthErrorHandler";
export default { title: "OAuth" };
const OAuthErrorTemplate = (args) => (
<OAuthErrorHandler baseId="someBaseId" {...args} />
);
export const InvalidRequest = OAuthErrorTemplate.bind({});
InvalidRequest.args = {
errorCode: "invalid_request",
};
export const UnauthorizedClient = OAuthErrorTemplate.bind({});
UnauthorizedClient.args = {
errorCode: "unauthorized_client",
};
export const AccessDenied = OAuthErrorTemplate.bind({});
AccessDenied.args = {
errorCode: "access_denied",
};
export const UnsupportedResponseType = OAuthErrorTemplate.bind({});
UnsupportedResponseType.args = {
errorCode: "unsupported_response_type",
};
export const InvalidScope = OAuthErrorTemplate.bind({});
InvalidScope.args = {
errorCode: "invalid_scope",
};
export const ServerError = OAuthErrorTemplate.bind({});
ServerError.args = {
errorCode: "server_error",
};
export const TemporarilyUnavailable = OAuthErrorTemplate.bind({});
TemporarilyUnavailable.args = {
errorCode: "temporarily_unavailable",
};
export const NoAuthCodeProvided = OAuthErrorTemplate.bind({});
NoAuthCodeProvided.args = {
errorCode: "no_auth_code_provided",
};
export const NoStateIdProvided = OAuthErrorTemplate.bind({});
NoStateIdProvided.args = {
errorCode: "no_state_id_provided",
};
export const GeneralServiceError = OAuthErrorTemplate.bind({});
GeneralServiceError.args = {
errorCode: "general_service_error",
};
export function OAuthLinkingMessageTest() {
return <OAuthLinkingMessage baseId="baseId" />;
}
OAuthLinkingMessageTest.storyName = "OAuth Linking Message Test";