Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(API): Add styling to credential callback and autoclose window #12648

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Load image from relative path
  • Loading branch information
dana-gill committed Jan 20, 2025
commit 9a38450057e9fd968618795aaa5b95162c499657
4 changes: 4 additions & 0 deletions packages/cli/src/abstract-server.ts
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ import { readFile } from 'fs/promises';
import type { Server } from 'http';
import isbot from 'isbot';
import { Logger } from 'n8n-core';
import path from 'path';

import config from '@/config';
import { N8N_VERSION, TEMPLATES_DIR, inDevelopment, inTest } from '@/constants';
@@ -67,6 +68,9 @@ export abstract class AbstractServer {
this.app.set('view engine', 'handlebars');
this.app.set('views', TEMPLATES_DIR);

const assetsPath: string = path.join(__dirname, '../../../assets');
this.app.use(express.static(assetsPath));

const proxyHops = config.getEnv('proxy_hops');
if (proxyHops > 0) this.app.set('trust proxy', proxyHops);

Original file line number Diff line number Diff line change
@@ -149,7 +149,7 @@ export class OAuth2CredentialController extends AbstractOAuthController {
credentialId: credential.id,
});

return res.render('oauth-callback');
return res.render('oauth-callback', { imagePath: 'n8n-logo.png' });
} catch (error) {
return this.renderCallbackError(
res,
2 changes: 1 addition & 1 deletion packages/cli/templates/oauth-callback.handlebars
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@
<div class="center-container">
<div class="left-container">
<div class="row">
<img src='https://github.com/n8n-io/n8n/blob/master/assets/n8n-logo.png?raw=true' class="logo" />
<img src="{{imagePath}}" class="logo" />
</div>
<div class="row">
<svg