const LoaderArgs = Context.GenericTag<LoaderFunctionArgs>('LoaderArgs');
export async function loader(args: LoaderFunctionArgs) {
console.log('args', args);
return ServerRuntime.runPromise(
T.gen(function* () {
const { authenticator } = yield* AuthService.getAuth;
const args2 = yield* LoaderArgs;
yield* T.log('authenticating');
yield* T.logInfo(args2.request);
return yield* T.promise(() =>
authenticator.authenticate('zitadel-openid', args2.request, {
successRedirect: '/admin',
failureRedirect: '/',
})
);
}).pipe(T.provideService(LoaderArgs, args))
);
}
export default function Login() {
return <></>;
}
const LoaderArgs = Context.GenericTag<LoaderFunctionArgs>('LoaderArgs');
export async function loader(args: LoaderFunctionArgs) {
console.log('args', args);
return ServerRuntime.runPromise(
T.gen(function* () {
const { authenticator } = yield* AuthService.getAuth;
const args2 = yield* LoaderArgs;
yield* T.log('authenticating');
yield* T.logInfo(args2.request);
return yield* T.promise(() =>
authenticator.authenticate('zitadel-openid', args2.request, {
successRedirect: '/admin',
failureRedirect: '/',
})
);
}).pipe(T.provideService(LoaderArgs, args))
);
}
export default function Login() {
return <></>;
}