Skip to content

Commit

Permalink
Merge branch 'main' into fix/cannot-set-headers
Browse files Browse the repository at this point in the history
  • Loading branch information
zoey-kaiser authored Aug 25, 2024
2 parents c2bef13 + ae2bf09 commit dfe1ab0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/.vitepress/routes/navbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const routes: DefaultTheme.Config['nav'] = [
],
},
{
text: '0.9.0',
text: '0.9.1',
items: [
{
text: '0.8.2',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sidebase/nuxt-auth",
"version": "0.9.0",
"version": "0.9.1",
"license": "MIT",
"type": "module",
"description": "Authentication built for Nuxt 3! Easily add authentication via OAuth providers, credentials or Email Magic URLs!",
Expand Down
5 changes: 3 additions & 2 deletions src/runtime/composables/local/useAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { navigateTo, nextTick, useNuxtApp, useRuntimeConfig } from '#imports'

type Credentials = { username?: string, email?: string, password?: string } & Record<string, any>

const signIn: SignInFunc<Credentials, any> = async (credentials, signInOptions, signInParams) => {
const signIn: SignInFunc<Credentials, any> = async (credentials, signInOptions, signInParams, signInHeaders) => {
const nuxt = useNuxtApp()

const runtimeConfig = await callWithNuxt(nuxt, useRuntimeConfig)
Expand All @@ -23,7 +23,8 @@ const signIn: SignInFunc<Credentials, any> = async (credentials, signInOptions,
const response = await _fetch<Record<string, any>>(nuxt, path, {
method,
body: credentials,
params: signInParams ?? {}
params: signInParams ?? {},
headers: signInHeaders ?? {}
})

const { rawToken, rawRefreshToken } = useAuthState()
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/composables/local/useAuthState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function useAuthState(): UseAuthStateReturn {
}
}

const refreshToken = computed(() => formatToken(rawRefreshToken.value, config))
const refreshToken = computed(() => rawRefreshToken.value)

return {
...commonAuthState,
Expand Down
3 changes: 2 additions & 1 deletion src/runtime/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,8 @@ export type SignOutFunc = (options?: SignOutOptions) => Promise<any>
export type SignInFunc<PrimarySignInOptions, SignInResult> = (
primaryOptions: PrimarySignInOptions,
signInOptions?: SecondarySignInOptions,
paramsOptions?: Record<string, string>
paramsOptions?: Record<string, string>,
headersOptions?: Record<string, string>
) => Promise<SignInResult>

export interface ModuleOptionsNormalized extends ModuleOptions {
Expand Down

0 comments on commit dfe1ab0

Please sign in to comment.