MCPcopy Create free account
hub / github.com/gitify-app/gitify / getNewOAuthAppURL

Function getNewOAuthAppURL

src/renderer/utils/auth/utils.ts:270–289  ·  view source on GitHub ↗
(hostname: Hostname)

Source from the content-addressed store, hash-verified

268 * @returns The URL with pre-filled query parameters.
269 */
270export function getNewOAuthAppURL(hostname: Hostname): Link {
271 const date = format(new Date(), 'PP p');
272 const newOAuthAppURL = new URL(
273 `https://${hostname}/settings/applications/new`,
274 );
275 newOAuthAppURL.searchParams.append(
276 'oauth_application[name]',
277 `${APPLICATION.NAME} (Created on ${date})`,
278 );
279 newOAuthAppURL.searchParams.append(
280 'oauth_application[url]',
281 'https://gitify.io',
282 );
283 newOAuthAppURL.searchParams.append(
284 'oauth_application[callback_url]',
285 'gitify://oauth',
286 );
287
288 return newOAuthAppURL.toString() as Link;
289}
290
291/**
292 * Return true if `hostname` is a valid DNS hostname (e.g. `github.com`).

Callers 2

utils.test.tsFile · 0.90
LoginWithOAuthAppRouteFunction · 0.90

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected