Skip to content

Commit

Permalink
Merge branch 'oauth2'
Browse files Browse the repository at this point in the history
  • Loading branch information
ENT8R committed Feb 14, 2024
2 parents 36c6510 + 4d76c7b commit 3f23cfb
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 536 deletions.
4 changes: 2 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"__VERSION__": "readonly",
"NOTESREVIEW_API_URL": "readonly",
"OPENSTREETMAP_SERVER": "readonly",
"OPENSTREETMAP_OAUTH_KEY": "readonly",
"OPENSTREETMAP_OAUTH_SECRET": "readonly",
"OPENSTREETMAP_OAUTH_CLIENT_ID": "readonly",
"OPENSTREETMAP_OAUTH_CLIENT_SECRET": "readonly",
"MAPILLARY_CLIENT_ID": "readonly"
},
"extends": ["eslint:recommended"],
Expand Down
11 changes: 6 additions & 5 deletions app/js/api.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import osmAuth from 'osm-auth';
import { osmAuth } from 'osm-auth';

const auth = osmAuth({
url: OPENSTREETMAP_SERVER,
oauth_consumer_key: OPENSTREETMAP_OAUTH_KEY, // eslint-disable-line camelcase
oauth_secret: OPENSTREETMAP_OAUTH_SECRET, // eslint-disable-line camelcase
auto: true,
landing: 'landing.html'
client_id: OPENSTREETMAP_OAUTH_CLIENT_ID, // eslint-disable-line camelcase
client_secret: OPENSTREETMAP_OAUTH_CLIENT_SECRET, // eslint-disable-line camelcase
redirect_uri: `${window.location.origin}${window.location.pathname}landing.html`, // eslint-disable-line camelcase
scope: 'read_prefs write_notes',
auto: true
});

export default class API {
Expand Down
5 changes: 2 additions & 3 deletions app/public/landing.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<!DOCTYPE html>
<html>
<head></head>
<html><head></head>
<body>
<script>
window.opener.authComplete(window.location.href);
opener.authComplete(window.location.href);
window.close();
</script>
</body>
Expand Down
Loading

0 comments on commit 3f23cfb

Please sign in to comment.