Skip to content

Commit

Permalink
allow the locale of the login page to be set
Browse files Browse the repository at this point in the history
  • Loading branch information
k-yle authored and bhousel committed Apr 26, 2024
1 parent 34f5735 commit a597d52
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/osm-auth.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ declare namespace OSMAuth {
singlepage?: boolean;
loading?: () => any;
done?: () => any;
locale?: string;
}

interface OSMAuthFetchOptions {
Expand Down
2 changes: 2 additions & 0 deletions src/osm-auth.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* @param o.singlepage If `true`, use page redirection instead of a popup (default: `false`)
* @param o.loading Function called when auth-related xhr calls start
* @param o.done Function called when auth-related xhr calls end
* @param o.locale The locale to use on the OAuth2 authentication page. Optional.
* @return `self`
*/
export function osmAuth(o) {
Expand Down Expand Up @@ -194,6 +195,7 @@ export function osmAuth(o) {
state: state,
code_challenge: pkce.code_challenge,
code_challenge_method: pkce.code_challenge_method,
locale: o.locale || "",
});

if (o.singlepage) {
Expand Down

0 comments on commit a597d52

Please sign in to comment.