login.ts 490 B

12345678910111213
  1. import { Request as ExpressRequest, Response as ExpressResponse } from "express";
  2. import { stringify } from "querystring";
  3. import { OAuth2 } from "src/util";
  4. import { ENVIRONMENT } from "src/environment";
  5. export const get = async (req: ExpressRequest, res: ExpressResponse): Promise<void> => {
  6. res.redirect(OAuth2.getAuthUrl({
  7. client_id: ENVIRONMENT.clientId,
  8. redirect_url: ENVIRONMENT.redirectUrl,
  9. response_type: "code",
  10. scope: "identify",
  11. }));
  12. };