studio-engine 0.72.3 → 0.73.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/views/solana_sessions/phantom_callback.html.erb +62 -0
- data/lib/studio/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 60486d6f2711eb8d61d258fa6305f05cfd2d85910858aacc1506dee587f3c114
|
|
4
|
+
data.tar.gz: beb3d3a69e3c01fca35a1196e37065b56b9b563696e2d7d3c6d15d5718440fd1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c668f68df4d51e460a58a3bfb6b8608acb943b9ab75558b7676c9ed79489219e686249e45c20593ec97c70401ed34c9b8ce78fafb927201912c1d0e87012fd1e
|
|
7
|
+
data.tar.gz: f9f13b69c48bd71d7ad127e1229245a7079dd0155dcfd731fe3044b25fcd439217e6dd61ca3f33b4c73b065cd8d5629dacd500218ac1b27cd02270f528f78e3a
|
|
@@ -137,6 +137,68 @@
|
|
|
137
137
|
dbg(' ' + key, truncate(val, 40));
|
|
138
138
|
});
|
|
139
139
|
|
|
140
|
+
// === THE REDIRECT TRANSPORT'S RETURN LEG ==============================
|
|
141
|
+
//
|
|
142
|
+
// TRIED FIRST, AND EVERYTHING BELOW IS LEFT EXACTLY AS IT WAS. The legacy
|
|
143
|
+
// block that follows handles ONE step — Phantom's signIn — with keys named
|
|
144
|
+
// phantom_dl_*, and it is what production mobile sign-in runs on TODAY. It is
|
|
145
|
+
// not touched, moved, or reworded here: a consumer that has not yet adopted
|
|
146
|
+
// the new transport must behave identically after this change, and the only
|
|
147
|
+
// honest way to promise that is to leave its code alone.
|
|
148
|
+
//
|
|
149
|
+
// GUARDED THE WAY THIS CODEBASE GUARDS EVERY OPTIONAL CAPABILITY: a host that
|
|
150
|
+
// does not load solana_studio/wallet_ops.js + wallet_journal.js has no
|
|
151
|
+
// SolanaStudio.walletOps, so this branch never runs and the legacy path is
|
|
152
|
+
// the whole program. An absent capability must not default to the permissive
|
|
153
|
+
// branch — the same rule the wallet picker's canDeepLink learned.
|
|
154
|
+
//
|
|
155
|
+
// WHY THE PENDING-JOURNAL CHECK IS PART OF THE GUARD, not just the globals:
|
|
156
|
+
// a host may load the new scripts while a signIn started under the OLD keys
|
|
157
|
+
// is still in flight — a user mid-round-trip across a deploy. Requiring an
|
|
158
|
+
// actual wallet_dl journal means that user finishes on the path they started,
|
|
159
|
+
// rather than being handed to a resumer with nothing to resume.
|
|
160
|
+
//
|
|
161
|
+
// WHAT THIS BRANCH DOES NOT DO: decrypt, verify, or know what the user was
|
|
162
|
+
// trying to accomplish. walletOps owns the step machine and the registered
|
|
163
|
+
// intent owns the outcome. This is a seam, and keeping it a seam is what lets
|
|
164
|
+
// the same callback serve sign-in and a contest entry without learning either.
|
|
165
|
+
var studio = window.SolanaStudio;
|
|
166
|
+
var hasResumer = !!(studio && studio.walletOps && typeof studio.walletOps.resume === 'function' &&
|
|
167
|
+
studio.walletJournal && typeof studio.walletJournal.peek === 'function');
|
|
168
|
+
|
|
169
|
+
if (hasResumer && studio.walletJournal.peek()) {
|
|
170
|
+
dbg('Transport', 'wallet_dl journal present — resuming through walletOps');
|
|
171
|
+
|
|
172
|
+
studio.walletOps.resume(params, {
|
|
173
|
+
navigate: function(url) { window.location.href = url; }
|
|
174
|
+
}).then(function(result) {
|
|
175
|
+
// SUSPENDED means resume already navigated to the next hop; this document
|
|
176
|
+
// is on its way out and must not also redirect, or the two race.
|
|
177
|
+
if (result && result.suspended) {
|
|
178
|
+
dbg('Transport', 'advanced to the next hop');
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
if (result && result.done) {
|
|
182
|
+
dbg('Transport', 'intent complete');
|
|
183
|
+
// The registered intent owns where to land — it knows what the user was
|
|
184
|
+
// doing. Falling back to '/' rather than guessing a wallet-specific
|
|
185
|
+
// destination, which this file has no business knowing.
|
|
186
|
+
window.location.href = (result.value && result.value.redirect) || '/';
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
// No pending request is a STATE, not a failure: a stale bookmark, a second
|
|
190
|
+
// tab, a reload after the journal was consumed. peek() said otherwise a
|
|
191
|
+
// moment ago, so this is a race, and the honest answer is to start over.
|
|
192
|
+
showError('No pending wallet request. Redirecting to login...');
|
|
193
|
+
}, function(err) {
|
|
194
|
+
// A user rejection arrives here with .rejected set — the wallet's own
|
|
195
|
+
// words, already mapped. Anything else is a genuine fault.
|
|
196
|
+
dbg('Transport ERROR', (err && err.message) || String(err));
|
|
197
|
+
showError((err && err.message) || 'Wallet request failed');
|
|
198
|
+
});
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
|
|
140
202
|
// Check for Phantom error
|
|
141
203
|
if (params.get('errorCode')) {
|
|
142
204
|
dbg('ERROR', 'errorCode=' + params.get('errorCode'));
|
data/lib/studio/version.rb
CHANGED