removed nextauth url

This commit is contained in:
biersoeckli
2024-11-27 07:32:03 +00:00
parent 2c13b07726
commit ce5a7d474d
5 changed files with 9 additions and 20 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ export const registerUser = async (prevState: any, inputData: RegisterFormInputS
value: url.hostname
});
await quickStackService.createOrUpdateIngress(url.hostname);
return new SuccessActionResult(undefined, 'QuickStack is now available at: ' + url.href);
return new SuccessActionResult(undefined, 'In a couple seconds QuickStack is available at: ' + url.href);
}
return new SuccessActionResult(undefined, 'Successfully registered user');
});
+1 -8
View File
@@ -34,14 +34,7 @@ export default function UserRegistrationForm() {
useEffect(() => {
if (state.status === 'success') {
toast.success(state.message ?? 'Registration successful. You can now login.');
const formValues = form.getValues();
signIn("credentials", {
username: formValues.email,
password: formValues.password,
redirect: false,
}).then(() => {
redirect('/');
});
window.location.reload();
}
}, [state]);
+4 -2
View File
@@ -43,8 +43,10 @@ export function NavBar() {
<DropdownMenuSeparator />
<DropdownMenuItem className="text-red-500"
onClick={() => signOut({
callbackUrl: "/auth",
redirect: true
callbackUrl: undefined,
redirect: false
}).then(() => {
window.open("/auth", "_self");
})}>
Logout
</DropdownMenuItem>
-2
View File
@@ -25,8 +25,6 @@ export const updateIngressSettings = async (prevState: any, inputData: QsIngress
await quickStackService.createOrUpdateService(!validatedData.disableNodePortAccess);
await quickStackService.createOrUpdateIngress(validatedData.serverUrl);
await quickStackService.createOrUpdateDeployment(url.hostname);
});
export const updateLetsEncryptSettings = async (prevState: any, inputData: QsLetsEncryptSettingsModel) =>
+3 -7
View File
@@ -16,14 +16,14 @@ class QuickStackService {
async updateQuickStack() {
const existingDeployment = await this.getExistingDeployment();
await this.createOrUpdateDeployment(existingDeployment.nextAuthHostname, existingDeployment.nextAuthSecret);
await this.createOrUpdateDeployment(existingDeployment.nextAuthSecret);
}
async initializeQuickStack() {
await namespaceService.createNamespaceIfNotExists(this.QUICKSTACK_NAMESPACE)
const nextAuthSecret = await this.deleteExistingDeployment();
await this.createOrUpdatePvc();
await this.createOrUpdateDeployment(undefined, nextAuthSecret);
await this.createOrUpdateDeployment(nextAuthSecret);
await this.createOrUpdateService(true);
await this.waitUntilQuickstackIsRunning();
console.log('QuickStack successfully initialized');
@@ -261,7 +261,7 @@ class QuickStackService {
}
}
async createOrUpdateDeployment(nextAuthHostname?: string, inputNextAuthSecret?: string, imageTag = 'latest') {
async createOrUpdateDeployment(inputNextAuthSecret?: string, imageTag = 'latest') {
const generatedNextAuthSecret = crypto.randomBytes(32).toString('base64');
const existingDeployment = await this.getExistingDeployment();
const body: V1Deployment = {
@@ -304,10 +304,6 @@ class QuickStackService {
name: 'NEXTAUTH_SECRET',
value: inputNextAuthSecret || existingDeployment.nextAuthSecret || generatedNextAuthSecret
},
...nextAuthHostname ? [{
name: 'NEXTAUTH_URL',
value: `https://${nextAuthHostname}`
}] : [],
...process.env.K3S_JOIN_TOKEN ? [{
name: 'K3S_JOIN_TOKEN',
value: process.env.K3S_JOIN_TOKEN