duodealer_app 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/app/controllers/duodealer_app/callback_controller.rb +10 -10
- data/app/controllers/duodealer_app/sessions_controller.rb +23 -23
- data/app/controllers/duodealer_app/webhooks_controller.rb +1 -1
- data/lib/duodealer_app/controller_concerns/login_protection.rb +29 -29
- data/lib/duodealer_app/controller_concerns/webhook_verification.rb +2 -2
- data/lib/duodealer_app/jobs/scripttags_manager_job.rb +3 -3
- data/lib/duodealer_app/jobs/webhooks_manager_job.rb +2 -2
- data/lib/duodealer_app/version.rb +1 -1
- data/lib/generators/duodealer_app/install/templates/duodealer_provider.rb +0 -2
- data/lib/generators/duodealer_app/rotate_duodealer_token_job/templates/rotate_duodealer_token_job.rb +7 -7
- metadata +2 -18
- data/app/controllers/concerns/duodealer_app/authenticated.rb-e +0 -15
- data/app/controllers/duodealer_app/authenticated_controller.rb-e +0 -9
- data/app/controllers/duodealer_app/callback_controller.rb-e +0 -104
- data/app/controllers/duodealer_app/extension_verification_controller.rb-e +0 -19
- data/app/controllers/duodealer_app/sessions_controller.rb-e +0 -159
- data/app/controllers/duodealer_app/webhooks_controller.rb-e +0 -37
- data/app/views/duodealer_app/partials/_button_styles.html.erb-e +0 -104
- data/app/views/duodealer_app/partials/_card_styles.html.erb-e +0 -33
- data/app/views/duodealer_app/partials/_empty_state_styles.html.erb-e +0 -129
- data/app/views/duodealer_app/partials/_layout_styles.html.erb-e +0 -167
- data/app/views/duodealer_app/partials/_typography_styles.html.erb-e +0 -35
- data/app/views/duodealer_app/sessions/enable_cookies.html.erb-e +0 -75
- data/app/views/duodealer_app/sessions/new.html.erb-e +0 -123
- data/app/views/duodealer_app/sessions/request_storage_access.html.erb-e +0 -68
- data/app/views/duodealer_app/sessions/top_level_interaction.html.erb-e +0 -64
- data/app/views/duodealer_app/shared/redirect.html.erb-e +0 -23
@@ -1,75 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html lang="<%= I18n.locale %>">
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8" />
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
6
|
-
<base target="_top">
|
7
|
-
<title>Redirecting…</title>
|
8
|
-
<%= render 'duodealer_app/partials/layout_styles' %>
|
9
|
-
<%= render 'duodealer_app/partials/typography_styles' %>
|
10
|
-
<%= render 'duodealer_app/partials/card_styles' %>
|
11
|
-
<%= render 'duodealer_app/partials/button_styles' %>
|
12
|
-
<style>
|
13
|
-
#CookiePartitionPrompt {
|
14
|
-
display: none;
|
15
|
-
}
|
16
|
-
</style>
|
17
|
-
<script>
|
18
|
-
window.apiKey = "<%= DuodealerApp.configuration.api_key %>";
|
19
|
-
window.shopOrigin = "https://<%= @shop %>";
|
20
|
-
window.returnTo = "<%= params[:return_to] %>"
|
21
|
-
</script>
|
22
|
-
|
23
|
-
<%= javascript_include_tag('duodealer_app/enable_cookies', crossorigin: 'anonymous', integrity: true) %>
|
24
|
-
</head>
|
25
|
-
<body>
|
26
|
-
<%=
|
27
|
-
content_tag(
|
28
|
-
:div, nil,
|
29
|
-
id: 'redirection-target',
|
30
|
-
data: {
|
31
|
-
target: {
|
32
|
-
duodealerUrl: "https://#{current_duodealer_domain}",
|
33
|
-
hasStorageAccessUrl: "#{has_storage_access_url}",
|
34
|
-
doesNotHaveStorageAccessUrl: "#{does_not_have_storage_access_url}",
|
35
|
-
appTargetUrl: "#{app_target_url}"
|
36
|
-
},
|
37
|
-
},
|
38
|
-
)
|
39
|
-
%>
|
40
|
-
<main id="CookiePartitionPrompt">
|
41
|
-
<div class="Polaris-Page">
|
42
|
-
<div class="Polaris-Page__Content">
|
43
|
-
<div class="Polaris-Layout">
|
44
|
-
<div class="Polaris-Layout__Section">
|
45
|
-
<div class="Polaris-Stack Polaris-Stack--vertical">
|
46
|
-
<div class="Polaris-Stack__Item">
|
47
|
-
<div class="Polaris-Card">
|
48
|
-
<div class="Polaris-Card__Header">
|
49
|
-
<h1 class="Polaris-Heading"><%= I18n.t('enable_cookies_heading', app: DuodealerApp.configuration.application_name) %></h1>
|
50
|
-
</div>
|
51
|
-
<div class="Polaris-Card__Section">
|
52
|
-
<p><%= I18n.t('enable_cookies_body', app: DuodealerApp.configuration.application_name) %></p>
|
53
|
-
</div>
|
54
|
-
<div class="Polaris-Card__Section Polaris-Card__Section--subdued">
|
55
|
-
<p><%= I18n.t('enable_cookies_footer') %></p>
|
56
|
-
</div>
|
57
|
-
</div>
|
58
|
-
</div>
|
59
|
-
<div class="Polaris-Stack__Item">
|
60
|
-
<div class="Polaris-Stack Polaris-Stack--distributionTrailing">
|
61
|
-
<div class="Polaris-Stack__Item">
|
62
|
-
<button type="button" class="Polaris-Button Polaris-Button--primary" id="AcceptCookies">
|
63
|
-
<span class="Polaris-Button__Content"><span><%= I18n.t('enable_cookies_action') %></span></span>
|
64
|
-
</button>
|
65
|
-
</div>
|
66
|
-
</div>
|
67
|
-
</div>
|
68
|
-
</div>
|
69
|
-
</div>
|
70
|
-
</div>
|
71
|
-
</div>
|
72
|
-
</div>
|
73
|
-
</main>
|
74
|
-
</body>
|
75
|
-
</html>
|
@@ -1,123 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html lang="en">
|
3
|
-
<head>
|
4
|
-
<title>Duo Dealer App — Installation</title>
|
5
|
-
|
6
|
-
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
8
|
-
|
9
|
-
<style>
|
10
|
-
* {
|
11
|
-
-moz-box-sizing: border-box;
|
12
|
-
-webkit-box-sizing: border-box;
|
13
|
-
box-sizing: border-box;
|
14
|
-
}
|
15
|
-
|
16
|
-
body {
|
17
|
-
padding: 2.5em 0;
|
18
|
-
color: #212b37;
|
19
|
-
font-family: -apple-system,BlinkMacSystemFont,San Francisco,Roboto,Segoe UI,Helvetica Neue,sans-serif;
|
20
|
-
}
|
21
|
-
|
22
|
-
.container {
|
23
|
-
width: 100%;
|
24
|
-
text-align: center;
|
25
|
-
margin-left: auto;
|
26
|
-
margin-right: auto;
|
27
|
-
}
|
28
|
-
|
29
|
-
@media screen and (min-width: 510px) {
|
30
|
-
.container {
|
31
|
-
width: 510px;
|
32
|
-
}
|
33
|
-
}
|
34
|
-
|
35
|
-
.title {
|
36
|
-
font-size: 1.5em;
|
37
|
-
margin: 2em auto;
|
38
|
-
display: flex;
|
39
|
-
align-items: center;
|
40
|
-
justify-content: center;
|
41
|
-
word-break: break-all;
|
42
|
-
}
|
43
|
-
|
44
|
-
.subtitle {
|
45
|
-
font-size: 0.8em;
|
46
|
-
font-weight: 500;
|
47
|
-
color: #64737f;
|
48
|
-
line-height: 2em;
|
49
|
-
}
|
50
|
-
|
51
|
-
.error {
|
52
|
-
line-height: 1em;
|
53
|
-
padding: 0.5em;
|
54
|
-
color: red;
|
55
|
-
}
|
56
|
-
|
57
|
-
input.marketing-input {
|
58
|
-
width: 100%;
|
59
|
-
height: 52px;
|
60
|
-
padding: 0 15px;
|
61
|
-
box-shadow: 0 0 0 1px #ddd;
|
62
|
-
border: 0;
|
63
|
-
border-radius: 5px;
|
64
|
-
background-color: #fff;
|
65
|
-
font-size: 1em;
|
66
|
-
margin-bottom: 15px;
|
67
|
-
}
|
68
|
-
|
69
|
-
input.marketing-input:focus {
|
70
|
-
color: #000;
|
71
|
-
outline: 0;
|
72
|
-
box-shadow: 0 0 0 2px #5e6ebf;
|
73
|
-
}
|
74
|
-
|
75
|
-
button.marketing-button {
|
76
|
-
display: inline-block;
|
77
|
-
width: 100%;
|
78
|
-
padding: 1.0625em 1.875em;
|
79
|
-
background-color: #5e6ebf;
|
80
|
-
color: #fff;
|
81
|
-
font-weight: 700;
|
82
|
-
font-size: 1em;
|
83
|
-
text-align: center;
|
84
|
-
outline: none;
|
85
|
-
border: 0 solid transparent;
|
86
|
-
border-radius: 5px;
|
87
|
-
cursor: pointer;
|
88
|
-
}
|
89
|
-
|
90
|
-
button.marketing-button:hover {
|
91
|
-
background: linear-gradient(to bottom, #5c6ac4, #4959bd);
|
92
|
-
border-color: #3f4eae;
|
93
|
-
}
|
94
|
-
|
95
|
-
button.marketing-button:focus {
|
96
|
-
box-shadow: 0 0 0.1875em 0.1875em rgba(94,110,191,0.5);
|
97
|
-
background-color: #223274;
|
98
|
-
color: #fff;
|
99
|
-
}
|
100
|
-
</style>
|
101
|
-
</head>
|
102
|
-
<body>
|
103
|
-
|
104
|
-
<main class="container" role="main">
|
105
|
-
<% application_name = DuodealerApp.configuration.application_name %>
|
106
|
-
<h3 class="title">
|
107
|
-
<%= application_name.presence || 'Duo Dealer App – Installation' %>
|
108
|
-
</h3>
|
109
|
-
<p class="subtitle">
|
110
|
-
<label for="shop">Enter your shop domain to log in or install this app.</label>
|
111
|
-
</p>
|
112
|
-
|
113
|
-
<%= form_tag login_path do %>
|
114
|
-
<% if flash[:error] %>
|
115
|
-
<div class="error"><%= flash[:error] %></div>
|
116
|
-
<% end %>
|
117
|
-
<input id="shop" name="shop" type="text" autofocus="autofocus" placeholder="example.duodealer.com" class="marketing-input">
|
118
|
-
<button type="submit" class="marketing-button">Install</button>
|
119
|
-
<% end %>
|
120
|
-
</main>
|
121
|
-
|
122
|
-
</body>
|
123
|
-
</html>
|
@@ -1,68 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html lang="<%= I18n.locale %>">
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8" />
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
6
|
-
<base target="_top">
|
7
|
-
<title>Redirecting…</title>
|
8
|
-
<%= render 'duodealer_app/partials/layout_styles' %>
|
9
|
-
<%= render 'duodealer_app/partials/typography_styles' %>
|
10
|
-
<%= render 'duodealer_app/partials/card_styles' %>
|
11
|
-
<%= render 'duodealer_app/partials/button_styles' %>
|
12
|
-
<style>
|
13
|
-
#RequestStorageAccess {
|
14
|
-
display: none;
|
15
|
-
}
|
16
|
-
</style>
|
17
|
-
</head>
|
18
|
-
<body>
|
19
|
-
<%=
|
20
|
-
content_tag(:div, nil,
|
21
|
-
id: 'redirection-target',
|
22
|
-
data: {
|
23
|
-
target: {
|
24
|
-
duodealerUrl: "https://#{current_duodealer_domain}",
|
25
|
-
hasStorageAccessUrl: "#{has_storage_access_url}",
|
26
|
-
doesNotHaveStorageAccessUrl: "#{does_not_have_storage_access_url}",
|
27
|
-
appTargetUrl: "#{app_target_url}"
|
28
|
-
},
|
29
|
-
},
|
30
|
-
)
|
31
|
-
%>
|
32
|
-
<main id="RequestStorageAccess">
|
33
|
-
<div class="Polaris-Page">
|
34
|
-
<div class="Polaris-Page__Content">
|
35
|
-
<div class="Polaris-Layout">
|
36
|
-
<div class="Polaris-Layout__Section">
|
37
|
-
<div class="Polaris-Stack Polaris-Stack--vertical">
|
38
|
-
<div class="Polaris-Stack__Item">
|
39
|
-
<div class="Polaris-Card">
|
40
|
-
<div class="Polaris-Card__Header">
|
41
|
-
<h1 class="Polaris-Heading"><%= I18n.t('request_storage_access_heading', app: DuodealerApp.configuration.application_name) %></h1>
|
42
|
-
</div>
|
43
|
-
<div class="Polaris-Card__Section">
|
44
|
-
<p><%= I18n.t('request_storage_access_body', app: DuodealerApp.configuration.application_name) %></p>
|
45
|
-
</div>
|
46
|
-
<div class="Polaris-Card__Section Polaris-Card__Section--subdued">
|
47
|
-
<p><%= I18n.t('request_storage_access_footer') %></p>
|
48
|
-
</div>
|
49
|
-
</div>
|
50
|
-
</div>
|
51
|
-
<div class="Polaris-Stack__Item">
|
52
|
-
<div class="Polaris-Stack Polaris-Stack--distributionTrailing">
|
53
|
-
<div class="Polaris-Stack__Item">
|
54
|
-
<button type="button" class="Polaris-Button Polaris-Button--primary" id="TriggerAllowCookiesPrompt">
|
55
|
-
<span class="Polaris-Button__Content"><span><%= I18n.t('request_storage_access_action') %></span></span>
|
56
|
-
</button>
|
57
|
-
</div>
|
58
|
-
</div>
|
59
|
-
</div>
|
60
|
-
</div>
|
61
|
-
</div>
|
62
|
-
</div>
|
63
|
-
</div>
|
64
|
-
</div>
|
65
|
-
</main>
|
66
|
-
<%= javascript_include_tag('duodealer_app/request_storage_access', crossorigin: 'anonymous', integrity: true) %>
|
67
|
-
</body>
|
68
|
-
</html>
|
@@ -1,64 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html lang="<%= I18n.locale %>">
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8" />
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
6
|
-
<base target="_top">
|
7
|
-
<title>Redirecting…</title>
|
8
|
-
<%= render 'duodealer_app/partials/layout_styles' %>
|
9
|
-
<%= render 'duodealer_app/partials/typography_styles' %>
|
10
|
-
<%= render 'duodealer_app/partials/button_styles' %>
|
11
|
-
<%= render 'duodealer_app/partials/empty_state_styles' %>
|
12
|
-
<style>
|
13
|
-
#TopLevelInteractionContent {
|
14
|
-
display: none;
|
15
|
-
}
|
16
|
-
</style>
|
17
|
-
|
18
|
-
<script>
|
19
|
-
window.apiKey = "<%= DuodealerApp.configuration.api_key %>";
|
20
|
-
window.shopOrigin = "https://<%= @shop %>";
|
21
|
-
window.redirectUrl = "<%= @url %>";
|
22
|
-
</script>
|
23
|
-
|
24
|
-
<%= javascript_include_tag('duodealer_app/top_level', crossorigin: 'anonymous', integrity: true) %>
|
25
|
-
</head>
|
26
|
-
<body>
|
27
|
-
<main id="TopLevelInteractionContent">
|
28
|
-
<div class="Polaris-Page">
|
29
|
-
<div class="Polaris-Page__Content">
|
30
|
-
<div class="Polaris-Layout">
|
31
|
-
<div class="Polaris-Layout__Section">
|
32
|
-
<div class="Polaris-Stack Polaris-Stack--vertical">
|
33
|
-
<div class="Polaris-Stack__Item">
|
34
|
-
<div class="Polaris-EmptyState">
|
35
|
-
<div class="Polaris-EmptyState__Section">
|
36
|
-
<div class="Polaris-EmptyState__DetailsContainer">
|
37
|
-
<div class="Polaris-EmptyState__Details">
|
38
|
-
<div class="Polaris-TextContainer">
|
39
|
-
<h1 class="Polaris-DisplayText Polaris-DisplayText--sizeMedium"><%= I18n.t('top_level_interaction_heading', app: DuodealerApp.configuration.application_name) %></h1>
|
40
|
-
<div class="Polaris-EmptyState__Content">
|
41
|
-
<p><%= I18n.t('top_level_interaction_body', app: DuodealerApp.configuration.application_name) %></p>
|
42
|
-
</div>
|
43
|
-
</div>
|
44
|
-
<div class="Polaris-EmptyState__Actions">
|
45
|
-
<div class="Polaris-Stack Polaris-Stack--alignmentCenter">
|
46
|
-
<div class="Polaris-Stack__Item"><button type="button" id="TopLevelInteractionButton" class="Polaris-Button Polaris-Button--primary Polaris-Button--sizeLarge"><span class="Polaris-Button__Content"><span class="Polaris-Button__Icon"></span><span><%= I18n.t('top_level_interaction_action') %></span></span></button></div>
|
47
|
-
</div>
|
48
|
-
</div>
|
49
|
-
</div>
|
50
|
-
</div>
|
51
|
-
<div class="Polaris-EmptyState__ImageContainer">
|
52
|
-
<%= image_tag 'storage_access.svg', role: "presentation", alt: "", class: "Polaris-EmptyState__Image" %>
|
53
|
-
</div>
|
54
|
-
</div>
|
55
|
-
</div>
|
56
|
-
</div>
|
57
|
-
</div>
|
58
|
-
</div>
|
59
|
-
</div>
|
60
|
-
</div>
|
61
|
-
</div>
|
62
|
-
</main>
|
63
|
-
</body>
|
64
|
-
</html>
|
@@ -1,23 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html lang="en">
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8" />
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
6
|
-
<base target="_top">
|
7
|
-
<title>Redirecting…</title>
|
8
|
-
<%= javascript_include_tag('duodealer_app/redirect', crossorigin: 'anonymous', integrity: true) %>
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
<%=
|
12
|
-
content_tag(:div, nil,
|
13
|
-
id: 'redirection-target',
|
14
|
-
data: {
|
15
|
-
target: {
|
16
|
-
duodealerUrl: "https://#{current_duodealer_domain}",
|
17
|
-
url: url,
|
18
|
-
},
|
19
|
-
},
|
20
|
-
)
|
21
|
-
%>
|
22
|
-
</body>
|
23
|
-
</html>
|