@ianlucas/remix-auth-steam 4.0.0 → 4.1.0-beta.1

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.
package/dist/index.js CHANGED
@@ -46,33 +46,40 @@ export class SteamStrategy extends Strategy {
46
46
  onError?.(error);
47
47
  }
48
48
  };
49
- const relyingParty = new OpenID.RelyingParty(returnURL, realm ?? null, true, false, []);
50
- const steamApi = new SteamAPI(apiKey);
51
49
  try {
52
- const result = await verifySteamAssertion(relyingParty, request);
53
- if (!result.authenticated || !result.claimedIdentifier)
54
- return this.failure(`Not authenticated from result`, request, sessionStorage, options);
55
- try {
56
- const userSteamID = result.claimedIdentifier.toString().split("/").at(-1);
57
- const steamUserSummary = (await steamApi.getUserSummary(userSteamID));
58
- const user = await this.verify({ user: steamUserSummary, request });
59
- return this.success(user, request, sessionStorage, options);
50
+ const relyingParty = new OpenID.RelyingParty(returnURL, realm ?? null, true, false, []);
51
+ const steamApi = new SteamAPI(apiKey);
52
+ const url = new URL(request.url);
53
+ const callbackUrl = new URL(returnURL);
54
+ if (url.pathname === callbackUrl.pathname) {
55
+ const result = await verifySteamAssertion(relyingParty, request);
56
+ if (!result.authenticated || !result.claimedIdentifier)
57
+ return this.failure(`Not authenticated from result`, request, sessionStorage, options);
58
+ try {
59
+ const userSteamID = result.claimedIdentifier.toString().split("/").at(-1);
60
+ const steamUserSummary = (await steamApi.getUserSummary(userSteamID));
61
+ const user = await this.verify({ user: steamUserSummary, request });
62
+ return this.success(user, request, sessionStorage, options);
63
+ }
64
+ catch (error) {
65
+ notifyError(error);
66
+ let message = error.message;
67
+ return this.failure(message, request, sessionStorage, options);
68
+ }
60
69
  }
61
- catch (error) {
62
- notifyError(error);
63
- let message = error.message;
64
- return this.failure(message, request, sessionStorage, options);
70
+ else {
71
+ try {
72
+ throw redirect(await authenticateToSteam(relyingParty));
73
+ }
74
+ catch (error) {
75
+ notifyError(error);
76
+ throw error;
77
+ }
65
78
  }
66
79
  }
67
80
  catch (error) {
68
81
  notifyError(error);
69
- try {
70
- throw redirect(await authenticateToSteam(relyingParty));
71
- }
72
- catch (error) {
73
- notifyError(error);
74
- throw error;
75
- }
82
+ throw error;
76
83
  }
77
84
  }
78
85
  }
package/package.json CHANGED
@@ -44,5 +44,5 @@
44
44
  "remix-auth": "^3.7.0",
45
45
  "steamapi": "^3.0.12"
46
46
  },
47
- "version": "4.0.0"
47
+ "version": "4.1.0-beta.1"
48
48
  }
@@ -1,30 +0,0 @@
1
- name: Publish Release (npm)
2
-
3
- on:
4
- release:
5
- types: [published]
6
-
7
- jobs:
8
- publish-npm:
9
- runs-on: ubuntu-latest
10
- permissions:
11
- id-token: write
12
- steps:
13
- - uses: actions/checkout@v4
14
- - uses: actions/setup-node@v4
15
- with:
16
- node-version: 22.x
17
- registry-url: "https://registry.npmjs.org"
18
- cache: "npm"
19
- - run: npm ci
20
- - run: npm version ${TAG_NAME} --git-tag-version=false
21
- env:
22
- TAG_NAME: ${{ github.ref_name }}
23
- - run: npm publish --provenance --access public --tag next
24
- if: "github.event.release.prerelease"
25
- env:
26
- NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
27
- - run: npm publish --provenance --access public
28
- if: "!github.event.release.prerelease"
29
- env:
30
- NODE_AUTH_TOKEN: ${{ secrets.npm_token }}