-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6e3340
commit 0731611
Showing
6 changed files
with
95 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,33 @@ | ||
# Nuxt 3 Minimal Starter | ||
## DistApp | ||
|
||
Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more. | ||
Distribute Android and iOS app. Alternative App Center Distribution with option to self-hosted your self | ||
|
||
## Setup | ||
|
||
Make sure to install the dependencies: | ||
#### Ensure you have the required .env | ||
|
||
```bash | ||
# yarn | ||
yarn install | ||
|
||
# npm | ||
npm install | ||
|
||
# pnpm | ||
pnpm install | ||
NUXT_DB_URL= | ||
NUXT_DB_AUTH_TOKEN= | ||
NUXT_S3_ENDPOINT= | ||
NUXT_S3_ACCESS_KEY_ID= | ||
NUXT_S3_SECRET_ACCESS_KEY= | ||
NUXT_JWT_KEY= | ||
NUXT_SIGNIN_KEY= | ||
NUXT_GOOGLE_CLIENT_ID= | ||
NUXT_GOOGLE_CLIENT_SECRET= | ||
NUXT_ADMIN_KEY_KEY= | ||
NUXT_PUBLIC_ADMIN_KEY_ENABLE= | ||
``` | ||
|
||
## Development Server | ||
|
||
Start the development server on `http://localhost:3000` | ||
#### Make sure to install the dependencies: | ||
|
||
```bash | ||
npm run dev | ||
ban install | ||
``` | ||
|
||
## Production | ||
|
||
Build the application for production: | ||
#### Development Server | ||
|
||
```bash | ||
npm run build | ||
bun run dev | ||
``` | ||
|
||
Locally preview production build: | ||
|
||
```bash | ||
npm run preview | ||
``` | ||
|
||
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,15 @@ | ||
import { getJwtKey } from '~/server/utils/utils' | ||
import * as jose from 'jose' | ||
|
||
import { generateUserToken, signInUser } from './callback.get' | ||
const alg = 'HS256' | ||
|
||
export default defineEventHandler(async (event) => { | ||
const { key } = await readBody(event) | ||
const config = useRuntimeConfig(event) | ||
if (key !== config.SIGNIN_KEY) { // for testing only | ||
if (key !== config.adminKey.key) { | ||
return setResponseStatus(event, 401) | ||
} | ||
|
||
const token = await new jose.SignJWT({ | ||
sub: 'b287aa5d85a040f78aa53a2ff7d53023', | ||
}).setProtectedHeader({ alg }) | ||
.setIssuedAt() | ||
.sign(getJwtKey(event)) | ||
setCookie(event, 'app-auth', token, { | ||
httpOnly: false, | ||
secure: true, | ||
sameSite: 'lax', | ||
}) | ||
const { token } = await generateUserToken(event, 'admin', '8ba3c4aa500f4c1e8ba84991960454c4', '[email protected]', 'Admin') | ||
signInUser(event, token) | ||
return { | ||
ok: true, | ||
} | ||
|