跳至内容
从 NextAuth.js v4 迁移?阅读 我们的迁移指南.

providers/42-school

内置的 42School 集成。

成就

属性

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;

校园

属性

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

属性

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

属性

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

属性

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

扩展

属性

achievements

achievements: Achievement[];

alumni

alumni: boolean;
继承自

UserData.alumni

anonymize_date

anonymize_date: string;
继承自

UserData.anonymize_date

campus

campus: Campus[];

campus_users

campus_users: CampusUser[];

correction_point

correction_point: number;
继承自

UserData.correction_point

created_at

created_at: string;
继承自

UserData.created_at

cursus_users

cursus_users: CursusUser[];

displayname

displayname: string;
继承自

UserData.displayname

email

email: string;
继承自

UserData.email

expertises_users

expertises_users: ExpertisesUser[];

first_name

first_name: string;
继承自

UserData.first_name

groups

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

id

id: number;
继承自

UserData.id

image

image: Image;

image_url

image_url: null | string;
继承自

UserData.image_url

is_launched?

is_launched?: boolean;
继承自

UserData.is_launched?

languages_users

languages_users: LanguagesUser[];

last_name

last_name: string;
继承自

UserData.last_name

location

location: null | string;
继承自

UserData.location

login

login: string;
继承自

UserData.login

partnerships

partnerships: any[];

patroned

patroned: any[];

patroning

patroning: any[];

phone

phone: null | string;
继承自

UserData.phone

pool_month

pool_month: null | string;
继承自

UserData.pool_month

pool_year

pool_year: null | string;
继承自

UserData.pool_year

projects_users

projects_users: ProjectUser[];

roles

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

staff?

staff?: boolean;
继承自

UserData.staff?

titles

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

titles_users

titles_users: TitlesUser[];

updated_at

updated_at: null | string;
继承自

UserData.updated_at

url

url: string;
继承自

UserData.url

user

user: any;

usual_first_name

usual_first_name: null | string;
继承自

UserData.usual_first_name

usual_full_name

usual_full_name: null | string;
继承自

UserData.usual_full_name

wallet

wallet: number;
继承自

UserData.wallet


Image

属性

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

属性

created_at

created_at: string;

id

id: number;

language_id

language_id: number;

position

position: number;

user_id

user_id: number;

ProjectUser

属性

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

属性

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

扩展自

属性

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>

在您的页面中添加 42School 登录。

设置

回调 URL

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

配置

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

资源

备注

42 在 Account 中返回一个名为 created_at 的字段,它是一个数字。 请查看 文档。 确保将此字段添加到您的数据库模式中,如果您正在使用 适配器

默认情况下,Auth.js 假设 42School 提供商基于 OAuth 2 规范。

💡

42School 提供商带有 默认配置。 要覆盖您的用例的默认值,请查看 自定义内置 OAuth 提供商

免责声明 如果您认为在默认配置中发现了错误,您可以 提交问题

Auth.js 严格遵守规范,对于提供商对规范的任何偏差,我们概不负责。 您可以提交问题,但如果问题是与规范不符,我们可能不会寻求解决。 您可以在 讨论 中寻求更多帮助。

类型参数

类型参数
P extends FortyTwoProfile

参数

参数类型
optionsOAuthUserConfig<P>

返回

OAuthConfig<P>

Auth.js © Balázs Orbán 和团队 -2024