Skip to content

Commit

Permalink
Fix redirect uri mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
ggodlewski committed Jul 2, 2024
1 parent 53d17bc commit a89314e
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/containers/server/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ export function validateGetAuthState(req: Request, res: Response, next) {

export async function handleDriveUiInstall(req: Request, res: Response, next) {
try {
const hostname = req.header('host');
const protocol = hostname.indexOf('localhost') > -1 ? 'http://' : 'https://';
const serverUrl = protocol + hostname;
const serverUrl = process.env.AUTH_DOMAIN || process.env.DOMAIN;

const state = new URLSearchParams(req.query.state.toString());
const driveui = urlToFolderId(state.get('driveui'));
Expand All @@ -129,9 +127,7 @@ export async function handleDriveUiInstall(req: Request, res: Response, next) {

export async function handleShare(req: Request, res: Response, next) {
try {
const hostname = req.header('host');
const protocol = hostname.indexOf('localhost') > -1 ? 'http://' : 'https://';
const serverUrl = protocol + hostname;
const serverUrl = process.env.AUTH_DOMAIN || process.env.DOMAIN;

const state = new URLSearchParams(req.query.state.toString());
const shareId = urlToFolderId(state.get('shareId'));
Expand Down Expand Up @@ -187,9 +183,7 @@ function sanitizeRedirect(redirectTo: string) {

export async function getAuth(req: Request, res: Response, next) {
try {
const hostname = req.header('host');
const protocol = hostname.indexOf('localhost') > -1 ? 'http://' : 'https://';
const serverUrl = protocol + hostname;
const serverUrl = process.env.AUTH_DOMAIN || process.env.DOMAIN;

const state = new URLSearchParams(req.query.state.toString());

Expand Down

0 comments on commit a89314e

Please sign in to comment.