This page details the frontend workflow needed to create bounties, using the Web UI

Key Requirements

API

Auth

Problem: How to effectively gate routes? How to provide flexibility in route gating?

We fetch the session from Discord using OAuth, NextAuth generates the user and session in the session object, it looks like it saves that using the getSession method.

Next.js - How to Get Session Information in Server Side vs Client Side iusing Next-auth

import { getSession } from 'next-auth/client'

export async function getServerSideProps({req}) {
  let headers = {}
  const session = await getSession({ req });
  if (session) {
    headers = {Authorization: `Bearer ${session.jwt}`};
  }
}

We can then run a gating module to check:

<aside> 💡 We could create our own JWT on the server side, based on the discord session from nextAuth, how would this work if the user changes DAOs? Does it need to be regenerated?

</aside>

Example for Bankless: