Skip to content

Commit

Permalink
[MIG] auth_oauth_autologin: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Loregs2 committed Jun 12, 2024
1 parent 698d53d commit deaec3a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 32 deletions.
6 changes: 2 additions & 4 deletions auth_oauth_autologin/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
"name": "Auth Oauth Autologin",
"summary": """
Automatically redirect to the OAuth provider for login""",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"maintainers": ["sbidoul"],
"website": "https://github.com/OCA/server-auth",
"depends": ["auth_oauth"],
"data": ["views/auth_oauth_provider.xml"],
"demo": [],
"assets": {
"web.assets_frontend": ["auth_oauth_autologin/static/src/js/web_login.js"]
},
"assets": {"web.assets_frontend": ["auth_oauth_autologin/static/src/js/*.js"]},
}
26 changes: 26 additions & 0 deletions auth_oauth_autologin/static/src/js/web_login.esm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/** @odoo-module **/

import publicWidget from "@web/legacy/js/public/public_widget";

publicWidget.registry.login.include({
selector: ".oe_login_form",
init() {
this._super(...arguments);
this._rpc = this.bindService("rpc");
},

start: async function () {
const def = this._super.apply(this, arguments);
let url = window.location.href;
if (url.includes("/web/login")) {
url = url.replace("/web/login", "/web");
}
this._result = await this._rpc("/auth/auto_login_redirect_link", {
redirect: url,
});
if (this._result) {
window.location = this._result;
}
return def;
},
});
28 changes: 0 additions & 28 deletions auth_oauth_autologin/static/src/js/web_login.js

This file was deleted.

0 comments on commit deaec3a

Please sign in to comment.