Merge pull request #6 from atridadl/dev
1.0.6 - Competently actualize resource-sucking vortals
🐛 Sending room links to signed out users now redirects to the original link once the user signs in (In nerd speak: I added a proper callback URL for signin requests)
This commit is contained in:
commit
8a0740c52a
5 changed files with 8 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "sprintpadawan",
|
"name": "sprintpadawan",
|
||||||
"version": "1.0.5",
|
"version": "1.0.6",
|
||||||
"description": "Plan. Sprint. Repeat.",
|
"description": "Plan. Sprint. Repeat.",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -68,7 +68,9 @@ const Navbar: React.FC<NavbarProps> = ({ title }) => {
|
||||||
</li>
|
</li>
|
||||||
)}
|
)}
|
||||||
<li>
|
<li>
|
||||||
<a onClick={() => void signOut()}>Sign Out</a>
|
<a onClick={() => void signOut({ callbackUrl: "/" })}>
|
||||||
|
Sign Out
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -18,7 +18,7 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||||
if (!session) {
|
if (!session) {
|
||||||
return {
|
return {
|
||||||
redirect: {
|
redirect: {
|
||||||
destination: "/",
|
destination: `/api/auth/signin?callbackUrl=${ctx.resolvedUrl}`,
|
||||||
permanent: false,
|
permanent: false,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -37,7 +37,7 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
|
||||||
if (!session) {
|
if (!session) {
|
||||||
return {
|
return {
|
||||||
redirect: {
|
redirect: {
|
||||||
destination: "/",
|
destination: `/api/auth/signin?callbackUrl=${ctx.resolvedUrl}`,
|
||||||
permanent: false,
|
permanent: false,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -12,6 +12,7 @@ import { prisma } from "~/server/db";
|
||||||
import type { Role } from "~/utils/types";
|
import type { Role } from "~/utils/types";
|
||||||
import { sendMail } from "fms-ts";
|
import { sendMail } from "fms-ts";
|
||||||
import { cacheClient, deleteFromCache } from "redicache-ts";
|
import { cacheClient, deleteFromCache } from "redicache-ts";
|
||||||
|
import { redirect } from "next/navigation";
|
||||||
|
|
||||||
const client = cacheClient(env.REDIS_URL);
|
const client = cacheClient(env.REDIS_URL);
|
||||||
|
|
||||||
|
@ -75,7 +76,7 @@ export const authOptions: NextAuthOptions = {
|
||||||
async signIn({}) {
|
async signIn({}) {
|
||||||
await deleteFromCache(client, env.APP_ENV, `kv_userlist_admin`);
|
await deleteFromCache(client, env.APP_ENV, `kv_userlist_admin`);
|
||||||
},
|
},
|
||||||
async signOut({}) {
|
async signOut() {
|
||||||
await deleteFromCache(client, env.APP_ENV, `kv_userlist_admin`);
|
await deleteFromCache(client, env.APP_ENV, `kv_userlist_admin`);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue