The student app's login page offers Microsoft 365 when the provider is configured, /auth/oauth/callback redeems the one-time code, a consent screen finishes a first sign-in, the profile attaches Microsoft through a link ticket, and the service worker leaves /oauth alone. The build also carries the summer presentation theme already committed in the frontend sources.
2 lines
932 B
JavaScript
2 lines
932 B
JavaScript
const s="/auth/oauth/callback";function f(r,n,i=window.location.origin){const t=new URLSearchParams({mode:"spa",action:n.action,frontend_callback:i+s,return_to:n.returnTo||"/"});return n.action==="link"&&n.linkTicket&&t.set("link_ticket",n.linkTicket),n.action==="register"&&(t.set("terms_accepted",n.consent?.terms?"1":"0"),t.set("privacy_accepted",n.consent?.privacy?"1":"0"),n.consent?.marketing&&t.set("marketing_consent","1")),`/oauth/${encodeURIComponent(r)}?${t.toString()}`}function e(r){if(Array.isArray(r)){for(const n of r)if(typeof n=="string"&&n!=="")return n;return""}return typeof r=="string"?r:""}function d(r){const n=e(r.error);if(n)return{kind:"error",message:n};const i=e(r.pending_registration);if(i){const o={kind:"pending",pending:i,provider:e(r.provider)},a=e(r.reason),c=e(r.email);return a&&(o.reason=a),c&&(o.email=c),o}const t=e(r.code);return t?{kind:"code",code:t}:{kind:"none"}}export{f as o,d as p};
|