Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ ARG NEXT_PUBLIC_DEFAULT_LOCALE=
ENV NEXT_PUBLIC_DEFAULT_LOCALE=$NEXT_PUBLIC_DEFAULT_LOCALE
# Commit SHA shown in the About screen. .dockerignore excludes .git, so
# `git rev-parse` inside the build can't find it - CI must pass it in.
ARG NEXT_PUBLIC_JMAP_AUTH_MODE=
ENV NEXT_PUBLIC_JMAP_AUTH_MODE=$NEXT_PUBLIC_JMAP_AUTH_MODE
ARG NEXT_PUBLIC_JMAP_REWRITE_SESSION_URLS=
ENV NEXT_PUBLIC_JMAP_REWRITE_SESSION_URLS=$NEXT_PUBLIC_JMAP_REWRITE_SESSION_URLS
ARG GIT_COMMIT=unknown
ENV GIT_COMMIT=$GIT_COMMIT
RUN npx next build --webpack
Expand Down
1 change: 1 addition & 0 deletions lib/jmap/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,7 @@ export class JMAPClient implements IJMAPClient {
}

private rewriteSessionUrl(url: string): string {
if (process.env.NEXT_PUBLIC_JMAP_REWRITE_SESSION_URLS === 'false') return url;
try {
const parsed = new URL(url);
const server = new URL(this.serverUrl);
Expand Down
3 changes: 3 additions & 0 deletions stores/auth-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,9 @@ export const useAuthStore = create<AuthState>()(
client.enableTotpReauth(password, () => useTotpReauthStore.getState().requestTotp());
debug.log('auth', 'TOTP re-auth enabled (legacy basic-auth path)');
}
} else if (process.env.NEXT_PUBLIC_JMAP_AUTH_MODE === 'bearer') {
client = JMAPClient.withBearer(serverUrl, password, username);
await client.connect();
} else {
client = new JMAPClient(serverUrl, username, password);
await client.connect();
Expand Down