fix: campaign wizard using wrong localStorage key for auth token
Was reading `auth_token`, should be `encryptid-token`. Also removes the premature client-side auth guard that blocked signed-in users. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
7f327eb07a
commit
90d511077c
|
|
@ -129,7 +129,7 @@ export class FolkCampaignWizard extends HTMLElement {
|
|||
}
|
||||
|
||||
private async apiFetch(path: string, opts: RequestInit = {}): Promise<Response> {
|
||||
const token = (window as any).__authToken || localStorage.getItem('auth_token') || '';
|
||||
const token = (window as any).__authToken || localStorage.getItem('encryptid-token') || '';
|
||||
return fetch(`${this.basePath}${path}`, {
|
||||
...opts,
|
||||
headers: {
|
||||
|
|
@ -170,12 +170,6 @@ export class FolkCampaignWizard extends HTMLElement {
|
|||
}
|
||||
|
||||
private async createWizard(): Promise<string | null> {
|
||||
const token = (window as any).__authToken || localStorage.getItem('auth_token') || '';
|
||||
if (!token) {
|
||||
this._error = 'Please sign in to create a campaign wizard';
|
||||
this.render();
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
const res = await this.apiFetch('/api/campaign/wizard', {
|
||||
method: 'POST',
|
||||
|
|
|
|||
Loading…
Reference in New Issue