Skip to content
Migrating from NextAuth.js v4? Read our migration guide.
API reference
42-school

providers/42-school

Built-in 42School integration.

Achievement

Properties

description

description: string;

id

id: number;

image

image: null | string;

kind

kind: "scolarity" | "project" | "pedagogy";

name

name: string;

nbr_of_success

nbr_of_success: null | number;

tier

tier: 
  | "none"
  | "medium"
  | "challenge"
  | "easy"
  | "hard";

users_url

users_url: string;

visible

visible: boolean;

Campus

Properties

active

active: boolean;

address

address: string;

city

city: string;

country

country: string;

default_hidden_phone

default_hidden_phone: boolean;

email_extension

email_extension: string;

facebook

facebook: string;

id

id: number;

language

language: {
  created_at: string;
  id: number;
  identifier: string;
  name: string;
  updated_at: null | string;
};
created_at
created_at: string;
id
id: number;
identifier
identifier: string;
name
name: string;
updated_at
updated_at: null | string;

name

name: string;

time_zone

time_zone: string;

twitter

twitter: string;

users_count

users_count: number;

vogsphere_id

vogsphere_id: number;

website

website: string;

zip

zip: string;

CampusUser

Properties

campus_id

campus_id: number;

created_at

created_at: string;

id

id: number;

is_primary

is_primary: boolean;

updated_at

updated_at: null | string;

user_id

user_id: number;

CursusUser

Properties

begin_at

begin_at: null | string;

blackholed_at

blackholed_at: null | string;

created_at

created_at: string;

cursus

cursus: {
  created_at: string;
  id: number;
  name: string;
  slug: string;
};
created_at
created_at: string;
id
id: number;
name
name: string;
slug
slug: string;

cursus_id

cursus_id: number;

end_at

end_at: null | string;

grade

grade: null | string;

has_coalition

has_coalition: boolean;

id

id: number;

level

level: number;

skills

skills: {
  id: number;
  level: number;
  name: string;
  }[];

updated_at

updated_at: null | string;

user

user: UserData;

ExpertisesUser

Properties

contact_me

contact_me: boolean;

created_at

created_at: string;

expertise_id

expertise_id: number;

id

id: number;

interested

interested: boolean;

user_id

user_id: number;

value

value: number;

FortyTwoProfile

Extends

Properties

achievements

achievements: Achievement[];

alumni

alumni: boolean;
Inherited from

UserData.alumni

anonymize_date

anonymize_date: string;
Inherited from

UserData.anonymize_date

campus

campus: Campus[];

campus_users

campus_users: CampusUser[];

correction_point

correction_point: number;
Inherited from

UserData.correction_point

created_at

created_at: string;
Inherited from

UserData.created_at

cursus_users

cursus_users: CursusUser[];

displayname

displayname: string;
Inherited from

UserData.displayname

email

email: string;
Inherited from

UserData.email

expertises_users

expertises_users: ExpertisesUser[];

first_name

first_name: string;
Inherited from

UserData.first_name

groups

groups: {
  id: string;
  name: string;
  }[];

id

id: number;
Inherited from

UserData.id

image

image: Image;

image_url

image_url: null | string;
Inherited from

UserData.image_url

is_launched?

is_launched?: boolean;
Inherited from

UserData.is_launched?

languages_users

languages_users: LanguagesUser[];

last_name

last_name: string;
Inherited from

UserData.last_name

location

location: null | string;
Inherited from

UserData.location

login

login: string;
Inherited from

UserData.login

partnerships

partnerships: any[];

patroned

patroned: any[];

patroning

patroning: any[];

phone

phone: null | string;
Inherited from

UserData.phone

pool_month

pool_month: null | string;
Inherited from

UserData.pool_month

pool_year

pool_year: null | string;
Inherited from

UserData.pool_year

projects_users

projects_users: ProjectUser[];

roles

roles: {
  id: string;
  name: string;
  }[];

staff?

staff?: boolean;
Inherited from

UserData.staff?

titles

titles: {
  id: string;
  name: string;
  }[];

titles_users

titles_users: TitlesUser[];

updated_at

updated_at: null | string;
Inherited from

UserData.updated_at

url

url: string;
Inherited from

UserData.url

user

user: any;

usual_first_name

usual_first_name: null | string;
Inherited from

UserData.usual_first_name

usual_full_name

usual_full_name: null | string;
Inherited from

UserData.usual_full_name

wallet

wallet: number;
Inherited from

UserData.wallet


Image

Properties

link

link: string;

versions

versions: {
  large: string;
  medium: string;
  micro: string;
  small: string;
};
large
large: string;
medium
medium: string;
micro
micro: string;
small
small: string;

LanguagesUser

Properties

created_at

created_at: string;

id

id: number;

language_id

language_id: number;

position

position: number;

user_id

user_id: number;

ProjectUser

Properties

created_at

created_at: string;

current_team_id

current_team_id: number;

cursus_ids

cursus_ids: number[];

final_mark

final_mark: null | number;

id

id: number;

marked

marked: boolean;

marked_at

marked_at: null | string;

occurrence

occurrence: number;

project

project: {
  id: number;
  name: string;
  parent_id: null | number;
  slug: string;
};
id
id: number;
name
name: string;
parent_id
parent_id: null | number;
slug
slug: string;

retriable_at

retriable_at: null | string;

status

status: "in_progress" | "finished";

updated_at

updated_at: null | string;

validated?

validated?: null | boolean;

TitlesUser

Properties

created_at

created_at: string;

id

id: number;

selected

selected: boolean;

title_id

title_id: number;

updated_at

updated_at: null | string;

user_id

user_id: number;

UserData

Extended by

Properties

alumni

alumni: boolean;

anonymize_date

anonymize_date: string;

correction_point

correction_point: number;

created_at

created_at: string;

displayname

displayname: string;

email

email: string;

first_name

first_name: string;

id

id: number;

image_url

image_url: null | string;

is_launched?

is_launched?: boolean;

last_name

last_name: string;

location

location: null | string;

login

login: string;

phone

phone: null | string;

pool_month

pool_month: null | string;

pool_year

pool_year: null | string;

staff?

staff?: boolean;

updated_at

updated_at: null | string;

url

url: string;

usual_first_name

usual_first_name: null | string;

usual_full_name

usual_full_name: null | string;

wallet

wallet: number;

default()

default<P>(options): OAuthConfig<P>

Add 42School login to your page.

Setup

Callback URL

https://example.com/api/auth/callback/42-school

Configuration

import Auth from "@auth/core"
import 42School from "@auth/core/providers/42-school"
 
const request = new Request(origin)
const response = await Auth(request, {
  providers: [42School({ clientId: 42_SCHOOL_CLIENT_ID, clientSecret: 42_SCHOOL_CLIENT_SECRET })],
})

Resources

Notes

42 returns a field on Account called created_at which is a number. See the docs. Make sure to add this field to your database schema, in case if you are using an Adapter.

By default, Auth.js assumes that the 42School provider is based on the OAuth 2 specification.

💡

The 42School provider comes with a default configuration. To override the defaults for your use case, check out customizing a built-in OAuth provider.

Disclaimer If you think you found a bug in the default configuration, you can open an issue.

Auth.js strictly adheres to the specification and it cannot take responsibility for any deviation from the spec by the provider. You can open an issue, but if the problem is non-compliance with the spec, we might not pursue a resolution. You can ask for more help in Discussions.

Type parameters

Type parameter
P extends FortyTwoProfile

Parameters

ParameterType
optionsOAuthUserConfig<P>

Returns

OAuthConfig<P>

Auth.js © Balázs Orbán and Team - 2024